我在Windows 7 SP1 x64中使用"Windows x86-64 embeddable zip file" python 3.7.3 distribution运行Python。我添加了pip脚本,它可以正常工作。
我尝试使用pip安装jupyter 1.0.0。发生此错误:
C:\Users\user\Downloads\python-3.7.3-embed-amd64>Scripts\pip.exe install jupyter
Collecting jupyter
Using cached jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)
Collecting ipykernel
Using cached ipykernel-5.1.4-py3-none-any.whl (116 kB)
.
.
[SUMMARIZED]
.
.
Collecting pywinpty>=0.5; os_name == "nt"
Using cached pywinpty-0.5.7-cp37-cp37m-win_amd64.whl (1.3 MB)
Collecting parso>=0.5.2
Using cached parso-0.6.1-py2.py3-none-any.whl (97 kB)
Collecting pyrsistent>=0.14.0
Using cached pyrsistent-0.15.7.tar.gz (107 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\downloads\python-3.7.3-embed-amd64\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-mvod9jy8\\pyrsistent\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-mvod9jy8\\pyrsistent\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\user\AppData\Local\Temp\pip-install-mvod9jy8\pyrsistent\pip-egg-info'
cwd: C:\Users\user\AppData\Local\Temp\pip-install-mvod9jy8\pyrsistent\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\user\AppData\Local\Temp\pip-install-mvod9jy8\pyrsistent\setup.py", line 10, in <module>
from _pyrsistent_version import __version__
ModuleNotFoundError: No module named '_pyrsistent_version'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
然后我尝试安装pyrsistent 0.15.7。发生相同的错误:
C:\Users\user\Downloads\python-3.7.3-embed-amd64>Scripts\pip.exe install pyrsistent
Collecting pyrsistent
Using cached pyrsistent-0.15.7.tar.gz (107 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\downloads\python-3.7.3-embed-amd64\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-ssyijah2\\pyrsistent\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-ssyijah2\\pyrsistent\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\user\AppData\Local\Temp\pip-install-ssyijah2\pyrsistent\pip-egg-info'
cwd: C:\Users\user\AppData\Local\Temp\pip-install-ssyijah2\pyrsistent\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\user\AppData\Local\Temp\pip-install-ssyijah2\pyrsistent\setup.py", line 10, in <module>
from _pyrsistent_version import __version__
ModuleNotFoundError: No module named '_pyrsistent_version'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
如何安装jupyter并解决此错误?
C:\Users\user\Downloads\pyrsistent-0.15.7
)在文本编辑器中打开setup.py
。评论line 10:
# from _pyrsistent_version import __version__
然后从此更改line 54:
version=__version__,
为此:
version='0.15.7',
通过点子从修改后的源安装pyrsistent:
C:\Users\user\Downloads\python-3.7.3-embed-amd64>Scripts\pip.exe install ..\pyrsistent-0.15.7
Processing c:\users\user\downloads\pyrsistent-0.15.7
Requirement already satisfied: six in c:\users\user\downloads\python-3.7.3-embed-amd64\lib\site-packages (from pyrsistent==0.15.7) (1.12.0)
Building wheels for collected packages: pyrsistent
Building wheel for pyrsistent (setup.py) ... done
Created wheel for pyrsistent: filename=pyrsistent-0.15.7-cp37-cp37m-win_amd64.whl size=56531 sha256=ae2ae62129ecd2aba69353b2cc335a23cbf53024a1ac211d01c1d792f465f0b0
Stored in directory: c:\users\user\appdata\local\pip\cache\wheels\ea\5a\2e\b0e3bb620adcd5a9a0d22e143161ab87ee02da6eb86e4b3657
Successfully built pyrsistent
Installing collected packages: pyrsistent
Successfully installed pyrsistent-0.15.7
C:\Users\user\Downloads\python-3.7.3-embed-amd64>Scripts\pip.exe install jupyter
Collecting jupyter
Using cached jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)
Collecting ipykernel
Using cached ipykernel-5.1.4-py3-none-any.whl (116 kB)
.
.
[SUMMARIZED]
.
.
Successfully installed MarkupSafe-1.1.1 Send2Trash-1.5.0 backcall-0.1.0 bleach-3.1.0 colorama-0.4.3 decorator-4.4.1 defusedxml-0.6.0 entrypoints-0.3 importlib-metadata-1.5.0 ipykernel-5.1.4 ipython-7.12.0 ipython-genutils-0.2.0 ipywidgets-7.5.1 jedi-0.16.0 jinja2-2.11.1 jsonschema-3.2.0 jupyter-1.0.0 jupyter-client-5.3.4 jupyter-console-6.1.0 jupyter-core-4.6.1 mistune-0.8.4 nbconvert-5.6.1 nbformat-5.0.4 notebook-6.0.3 pandocfilters-1.4.2 parso-0.6.1 pickleshare-0.7.5 prometheus-client-0.7.1 prompt-toolkit-3.0.3 pygments-2.5.2 pywin32-227 pywinpty-0.5.7 pyzmq-18.1.1 qtconsole-4.6.0 terminado-0.8.3 testpath-0.4.4 tornado-6.0.3 traitlets-4.3.3 wcwidth-0.1.8 webencodings-0.5.1 widgetsnbextension-3.5.1 zipp-2.2.0