首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何将CoolProp安装在python3.9+(windows)和PyDroid3(Android)中

如何将CoolProp安装在python3.9+(windows)和PyDroid3(Android)中
EN

Stack Overflow用户
提问于 2022-10-17 06:45:16
回答 1查看 41关注 0票数 0

我在python3.9上安装CoolProp有困难。它在python 2.7和使用python 3.7Thonny上安装得很好

当我尝试在python3.9.5和PyDroid3上运行pip安装PyDroid3时,我遇到了以下错误。

ERROR: Command Errored Out with exit status 1

我试过很多技巧,比如

代码语言:javascript
运行
复制
Upgrading pip
pip install CoolProp --user
pip -m install CoolProp
py -3 -m pip install CoolProp --user

似乎什么都起不到作用。

在安卓系统上使用PyDroid3也给我带来了同样的问题。

在计算机上使用PIP时,我收到一条消息:

代码语言:javascript
运行
复制
Building wheels for collected packages: CoolProp
  Building wheel for CoolProp (setup.py) ... error
  ERROR: Command errored out with exit status 1:
EN

回答 1

Stack Overflow用户

发布于 2022-10-17 06:45:16

我通过手工安装CoolProp解决了这个问题。以下是这样做的指示:

  • 首先在windows上运行pip install Cython,在PyDroid3中运行hamburger menu > pip > Search Libraries > Cython,然后从那里安装它。
  • GitHubSourceForge下载GitHub源代码。
  • 在Android和PC上,将压缩文件解压缩到一个单独的文件夹(任何您想要的文件夹,我个人创建一个文件夹(远离常规使用的文件夹)名为CK_CoolProp_Sources,并将其解压缩到其中,然后忘记该文件夹。我没有删除它,以免它弄坏了什么东西。
  • PC用
代码语言:javascript
运行
复制
- Run command prompt or PowerShell as an administrator.
- Type in the following commands:

cd \CoolProp-6.4.1\wrappers\Python

现在看起来应该是:

C:\\CoolProp-6.4.1\wrappers\Python>

现在输入:

python setup.py

让它跑吧。它会为你做一切。

  • For Pydroid3:
代码语言:javascript
运行
复制
- First change the **screen timeout duration** to the **maximum possible time** to prevent the screen from turning off. Screen turning off and locking will fail the installation (mine failed twice).
- Click on **Terminal** from within the hamburger menu inside PyDroid3.
- Type in the following commands:

cd \CoolProp-6.4.1\wrappers\Python

现在看起来应该是:

/storage/emulated/0//CoolProp-6.4.1/wrappers/Python $

现在输入:

python setup.py

看起来是这样的:

python setup.py 不让屏幕关闭,因为这会导致安装失败,您将不得不重新打开终端,导航到目录,并再次运行。

代码语言:javascript
运行
复制
- Once The terminal finishes installation, close PyDroid3 (remove from recent apps list also) and reopen it.
代码语言:javascript
运行
复制
- Now, go to interpreter (Hamburger menu inside PyDroid3) and type `import CoolProp`
代码语言:javascript
运行
复制
- If the screen did not turn off during Terminal Installation, It should work and look like this: 
代码语言:javascript
运行
复制
- If it doesn't work and gives any errors, `Pydroid3 - Hamburger Menu > Pip > Install(tab) >`  Enter CoolProp in the `Library Name` text field and click install. It will correct the issue. **It will say requirement already satisfied**, but it repairs the installation in the background or something. Looks like this: 
代码语言:javascript
运行
复制
- It works after that. Reopen PyDroid3 and `hamburger menu > Interpreter`

>>> import CoolProp应该能工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74093424

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档