python - 无法在 Windows : No module named '_pyrsistent_version' 上安装 jupyter

标签 python windows pip jupyter-notebook python-embedding

我使用 "Windows x86-64 embeddable zip file" python 3.7.3 distribution在 Windows 7 SP1 x64 中运行 Python。我已经添加了 pip 脚本并且它正在运行。

我尝试安装 jupyter 1.0.0使用 pip 。发生此错误:

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 并修复此错误?

最佳答案

  1. 下载pyrsistent 0.15.7来自 Download Files section 的源文件.
  2. 将存档解压缩到一个文件夹中(在本例中为 C:\Users\user\Downloads\pyrsistent-0.15.7)
  3. 在文本编辑器中打开 setup.py。评论 line 10 :

    # from _pyrsistent_version import __version__
    

    然后更改line 54来自:

        version=__version__,
    

    对此:

        version='0.15.7',
    
  4. 使用 pip 从修改后的源安装 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
    
  5. 使用 pip 安装 jupyter:
    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
    

关于python - 无法在 Windows : No module named '_pyrsistent_version' 上安装 jupyter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60135484/

相关文章:

python - 使用带有用户输入的循环通过 python 下载图像列表

c++ - 帮助在 C++ 中使用 PCRE

windows - 推送更改到 Git 不起作用

python - pypi:为什么不是所有的包都使用 wheel?

django - 在旧版 Django 项目中使用 virtualenv

python - 如何在启用 Two Factor 的情况下将包上传到 PyPi?

python - tornado + momoko 不处理连接

python - 将 'boxes' 与 imgflip 的 API 一起使用时出现错误消息

python - 来自 C 的 Python 中的按位运算

java - 用于快捷方式 URL 的 Windows 快捷方式 (.lnk .url) 解析器