1
我試圖建立pymysql爲蟒蛇3.3上窗口64位。在Windows上安裝導入錯誤pymysql:不能導入名稱FIELD_TYPE
我設法使用https://pypi.python.org/pypi/distribute#downloads easy_install的安裝我做了蟒蛇distribute_setup.py然後的easy_install開始工作。
現在,每當我試着做的easy_install pymysql我得到
Downloading/unpacking pymysql
Downloading PyMySQL-0.5.tar.gz
Running setup.py egg_info for package pymysql
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\users\cc\appdata\local\temp\pip-build-Cc\pymysql\setup.py", line 7, in <module>
version_tuple = __import__('pymysql').VERSION
File ".\pymysql\__init__.py", line 28, in <module>
from constants import FIELD_TYPE
ImportError: cannot import name FIELD_TYPE
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\users\cc\appdata\local\temp\pip-build-Cc\pymysql\setup.py", line 7, in <module>
version_tuple = __import__('pymysql').VERSION
File ".\pymysql\__init__.py", line 28, in <module>
from constants import FIELD_TYPE
ImportError: cannot import name FIELD_TYPE
----------------------------------------
Command python setup.py egg_info failed with error code 1 in c:\users\cc\appdata\local\temp\pip-build-Cc\pymysql
Storing complete log in C:\Users\Cc\pip\pip.log
最初的錯誤是「無法導入名稱‘常量’」然後我跑的easy_install常數和現在的錯誤是上面的一個。
編輯 在仔細看看,我看到他們說的Python 3.3做
echo "Building Python 3.0 version in ./py3k..."
rm -fr ./py3k
mkdir py3k
cp -rf pymysql py3k/
cp setup.py py3k/
cp setup.py.py3k.patch py3k/
cp CHANGELOG py3k/
cp README.rst py3k/
cp LICENSE py3k/
cd py3k
2to3 .|patch -p0
patch setup.py setup.py.py3k.patch
cd ..
任何想法,我怎麼能在Windows中執行此命令2to3的|。補丁-p0
我有同樣的問題,對了,linux的,我去https://code.google.com/p/pymysql/downloads/list 下載pymysql軟件包然後 $ python3 setup.py install --user – 2013-06-07 18:25:06