在Thonny安装Pyde时遇到了麻烦

发布于 2025-01-19 21:54:54 字数 1464 浏览 0 评论 0原文

我正在尝试安装库 PyDE 来对我所做的方程运行微分进化。每当我尝试在 thonny 中安装该库时,都会收到错误(如下所列)。

我不是最了解 pip 或错误含义的人,因此如果您能提供帮助,我将非常感激。

thonny 的 pip 窗口中的错误消息:

Collecting PyDE
  Downloading PyDE-1.0.1.tar.gz (2.6 kB)
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\charlie\AppData\Local\Programs\Thonny\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\charlie\\AppData\\Local\\Temp\\pip-install-jraruxxv\\PyDE\\setup.py'"'"'; __file__='"'"'C:\\Users\\charlie\\AppData\\Local\\Temp\\pip-install-jraruxxv\\PyDE\\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\charlie\AppData\Local\Temp\pip-pip-egg-info-wu08p02b'
         cwd: C:\Users\charlie\AppData\Local\Temp\pip-install-jraruxxv\PyDE\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\charlie\AppData\Local\Temp\pip-install-jraruxxv\PyDE\setup.py", line 5, in <module>
        with open('README.rst') as file:
    FileNotFoundError: [Errno 2] No such file or directory: 'README.rst'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Process returned with code 1

I'm trying to install the library PyDE to run a differential evolution on an equation I've made. Whenever I try to install the library in thonny, I get an error (listed below).

I'm not the most knowledgeable with pip or what the errors mean so if you can help out I'd really appreciate it.

The error message from thonny's pip window:

Collecting PyDE
  Downloading PyDE-1.0.1.tar.gz (2.6 kB)
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\charlie\AppData\Local\Programs\Thonny\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\charlie\\AppData\\Local\\Temp\\pip-install-jraruxxv\\PyDE\\setup.py'"'"'; __file__='"'"'C:\\Users\\charlie\\AppData\\Local\\Temp\\pip-install-jraruxxv\\PyDE\\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\charlie\AppData\Local\Temp\pip-pip-egg-info-wu08p02b'
         cwd: C:\Users\charlie\AppData\Local\Temp\pip-install-jraruxxv\PyDE\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\charlie\AppData\Local\Temp\pip-install-jraruxxv\PyDE\setup.py", line 5, in <module>
        with open('README.rst') as file:
    FileNotFoundError: [Errno 2] No such file or directory: 'README.rst'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Process returned with code 1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

微凉 2025-01-26 21:54:54

维护者忘记使用 setup.py 指令将 README.rst 文件打包到 tar.gz 存档中(很可能是 Python 包的源代码分发版) ,所以它失败了。手动下载存档,打开setup.py删除函数读取README.rst,然后手动安装。

visit https://pypi.org/project/PyDE/#files
wget https://files.pythonhosted.org/packages/7f/e1/2d1467ad0dea7340fb4d3441e9b47c23f5860b2ceb57465239073e04ae19/PyDE-1.0.1.tar.gz
tar xvzf PyDE-1.0.1.tar.gz
cd PyDE-1.0.1
# edit the setup.py to remove the open() function
pip install .

或者,从 GitHub 安装:

pip install https://github.com/hpparvi/PyDE/zipball/master

如果您想要精确版本,则没有适合您的分支或标签,但可能是 此提交 根据日期判断PyPI 包发布。在这种情况下,将 master 调整为提交哈希

pip install https://github.com/hpparvi/PyDE/zipball/7ad56574b9dcfe6f6f668ee52978c7cfeb4b3970

使用 GitHub 链接时它起作用的原因是因为 pip 将下载完整存储库的快照(zipball,其中包含 README.rst file) 而不是 PyPI 中损坏的存档(实际上没有)。

The maintainer forgot to package the README.rst file into the tar.gz archive (Python package's source distribution most likely) with setup.py instructions, so it's failing. Download the archive manually, open setup.py remove the function reading the README.rst and then install manually.

visit https://pypi.org/project/PyDE/#files
wget https://files.pythonhosted.org/packages/7f/e1/2d1467ad0dea7340fb4d3441e9b47c23f5860b2ceb57465239073e04ae19/PyDE-1.0.1.tar.gz
tar xvzf PyDE-1.0.1.tar.gz
cd PyDE-1.0.1
# edit the setup.py to remove the open() function
pip install .

Alternatively, install from GitHub:

pip install https://github.com/hpparvi/PyDE/zipball/master

If you want the exact version, there's no branch or tag for you, but it might be this commit judging by the date of the PyPI package release. In that case adjust the master to the commit hash

pip install https://github.com/hpparvi/PyDE/zipball/7ad56574b9dcfe6f6f668ee52978c7cfeb4b3970

The reason why it works when using the GitHub link is because pip will download the full repository's snapshot (zipball, which contains the README.rst file) instead of the broken archive from PyPI (which does not).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文