运行 Python pip 和 easy_install 抛出错误
Running Python pip and easy_install throwing up errors
我正准备安装一个新包 我被推荐使用 pip
或 easy_install
并且两者都抛出以下错误,我可以找出原因。
我已经清除了 temp
文件夹,一开始以为是这个问题。
我刚刚解决了 pip
错误,但如果需要可以添加 easy_install
c:\Python32\Scripts>easy_install PyMySQL
C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\pkg_resources\__init__.py:87: UserWarning: Support for Python 3.0-3.2 has been dropped. Future versions will fail here.
Searching for PyMySQL
Reading https://pypi.python.org/simple/PyMySQL/
Best match: PyMySQL 0.7.2
Downloading https://pypi.python.org/packages/source/P/PyMySQL/PyMySQL-0.7.2.tar.gz#md5=6d757cda8bfbd312714207f7c0bef5c7
Processing PyMySQL-0.7.2.tar.gz
Writing c:\users\jarratt\appdata\local\temp\easy_install-bf6ut8\PyMySQL-0.7.2\setup.cfg
Running PyMySQL-0.7.2\setup.py -q bdist_egg --dist-dir c:\users\jarratt\appdata\local\temp\easy_install-bf6ut8\PyMySQL-0.7.2\egg-dist-tmp-x5vabv
C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\pkg_resources\__init__.py:87: UserWarning: Support for Python 3.0-3.2 has been dropped. Future versions will fail here.
Traceback (most recent call last):
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\sandbox.py", line 154, in save_modules
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\sandbox.py", line 195, in setup_context
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\sandbox.py", line 243, in run_setup
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\sandbox.py", line 273, in run
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\sandbox.py", line 242, in runner
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\sandbox.py", line 46, in _execfile
File "c:\users\jarratt\appdata\local\temp\easy_install-bf6ut8\PyMySQL-0.7.2\setup.py", line 4, in <module>
File "c:\users\jarratt\appdata\local\temp\easy_install-bf6ut8\PyMySQL-0.7.2\pymysql\__init__.py", line 28, in <module>
File "c:\users\jarratt\appdata\local\temp\easy_install-bf6ut8\PyMySQL-0.7.2\pymysql\converters.py", line 59
_escape_table[0] = u'\0'
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Python32\Scripts\easy_install-script.py", line 9, in <module>
load_entry_point('setuptools==20.2.2', 'console_scripts', 'easy_install')()
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\command\easy_install.py", line 2244, in main
安装 Python 3.3 或更高版本。检查 PyMySQL 最低要求:
code of PyMySQL 使用 Unicode 文字。
错误消息回溯中目录名称的 py3.2
部分告诉我您正在使用 Python 3.2。虽然 Python 2 有 Unicode 文字,但 Python 3.0 到 3.2 没有:语法是 removed with Python 3.0:
You can no longer use u"..."
literals for Unicode text.
出于向后兼容的原因,它是 re-introduced with Python 3.3 by PEP 414。
与 and 一样,PyMySQL要求Python2.x≥2.6或3.x≥3.3,因此作者为什么PyMySQL 可以在其代码中随意使用 Unicode 文字语法。
我正准备安装一个新包 我被推荐使用 pip
或 easy_install
并且两者都抛出以下错误,我可以找出原因。
我已经清除了 temp
文件夹,一开始以为是这个问题。
我刚刚解决了 pip
错误,但如果需要可以添加 easy_install
c:\Python32\Scripts>easy_install PyMySQL
C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\pkg_resources\__init__.py:87: UserWarning: Support for Python 3.0-3.2 has been dropped. Future versions will fail here.
Searching for PyMySQL
Reading https://pypi.python.org/simple/PyMySQL/
Best match: PyMySQL 0.7.2
Downloading https://pypi.python.org/packages/source/P/PyMySQL/PyMySQL-0.7.2.tar.gz#md5=6d757cda8bfbd312714207f7c0bef5c7
Processing PyMySQL-0.7.2.tar.gz
Writing c:\users\jarratt\appdata\local\temp\easy_install-bf6ut8\PyMySQL-0.7.2\setup.cfg
Running PyMySQL-0.7.2\setup.py -q bdist_egg --dist-dir c:\users\jarratt\appdata\local\temp\easy_install-bf6ut8\PyMySQL-0.7.2\egg-dist-tmp-x5vabv
C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\pkg_resources\__init__.py:87: UserWarning: Support for Python 3.0-3.2 has been dropped. Future versions will fail here.
Traceback (most recent call last):
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\sandbox.py", line 154, in save_modules
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\sandbox.py", line 195, in setup_context
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\sandbox.py", line 243, in run_setup
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\sandbox.py", line 273, in run
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\sandbox.py", line 242, in runner
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\sandbox.py", line 46, in _execfile
File "c:\users\jarratt\appdata\local\temp\easy_install-bf6ut8\PyMySQL-0.7.2\setup.py", line 4, in <module>
File "c:\users\jarratt\appdata\local\temp\easy_install-bf6ut8\PyMySQL-0.7.2\pymysql\__init__.py", line 28, in <module>
File "c:\users\jarratt\appdata\local\temp\easy_install-bf6ut8\PyMySQL-0.7.2\pymysql\converters.py", line 59
_escape_table[0] = u'\0'
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Python32\Scripts\easy_install-script.py", line 9, in <module>
load_entry_point('setuptools==20.2.2', 'console_scripts', 'easy_install')()
File "C:\Python32\lib\site-packages\setuptools-20.2.2-py3.2.egg\setuptools\command\easy_install.py", line 2244, in main
安装 Python 3.3 或更高版本。检查 PyMySQL 最低要求:
code of PyMySQL 使用 Unicode 文字。
错误消息回溯中目录名称的 py3.2
部分告诉我您正在使用 Python 3.2。虽然 Python 2 有 Unicode 文字,但 Python 3.0 到 3.2 没有:语法是 removed with Python 3.0:
You can no longer use
u"..."
literals for Unicode text.
出于向后兼容的原因,它是 re-introduced with Python 3.3 by PEP 414。
与