我在我的项目中使用 python诗歌(https://python-poetry.org/)进行依赖管理。
虽然当我运行时poetry install,它给了我以下错误。
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
Run Code Online (Sandbox Code Playgroud)
我的笔记本电脑上安装了 python 3.9。
我使用安装了 numpy 1.21.5 pip install numpy,我什至尝试将其版本降低到 1.19.5。
虽然我遇到了同样的错误。
我发现很多人ERROR: Failed building wheel for numpy在 python 3.10 中遇到这个错误,他们通过将 python 版本降低到 3.9 来解决它,尽管这对我不起作用。
我使用以下命令安装了诗歌:-
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python -
要了解更多信息,请参阅此。
现在我想创建一个虚拟环境,我使用以下命令创建了它:-
poetry config virtualenvs.in-project true
要了解更多信息,请参阅此。
但是执行此操作后,我看不到任何 .venv(虚拟环境)文件夹。
要检查虚拟环境是否存在,我们使用以下命令:-
poetry config virtualenvs.in-project
如果上面的命令返回true,则意味着您已经拥有它。
我得到了,还有文档true中提到的位置,我在那里看不到它。
谁能告诉我现在如何定位虚拟环境?
详细错误消息:-
\n FileNotFoundError\n\n [WinError 2] The system cannot find the file specified\n\n at ~\\AppData\\Local\\Programs\\Python\\Python39\\lib\\subprocess.py:1582 in _execute_child\n 1578\xe2\x94\x82 sys.audit("subprocess.Popen", executable, args, cwd, env)\n 1579\xe2\x94\x82 \n 1580\xe2\x94\x82 # Start the process\n 1581\xe2\x94\x82 try:\n \xe2\x86\x92 1582\xe2\x94\x82 hp, ht, pid, tid = _winapi.CreateProcess(\n 1583\xe2\x94\x82 executable,\n 1584\xe2\x94\x82 args,\n 1585\xe2\x94\x82 # no special security\n 1586\xe2\x94\x82 None,\nmake: *** [makefile:14: format] Error 1\n\nRun Code Online (Sandbox Code Playgroud)\n我们在这里列出了类似的问题:https ://bugs.python.org/issue17023
\n文件在那里,路径也很好。\n但是为什么我会收到此错误,因为文件位于指定位置?
\n我在运行格式化程序 linter 时收到此错误。
\n当我运行以下命令来安装tensorflow时,出现此错误。
python3 -m pip install tensorflow-macos
Run Code Online (Sandbox Code Playgroud)
ERROR: Failed building wheel for h5py
Failed to build h5py
ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects
Run Code Online (Sandbox Code Playgroud)
我厌倦了从官方链接( https://pypi.org/project/h5py/#files )手动安装这个轮子,它已正确安装,但我仍然遇到相同的错误。
我在 Mac Book M1 芯片上遇到了上述问题。
我使用的是带有 M1 芯片的 MacBook,但似乎有很多东西没有针对它进行优化。
pyodbc不适合我,所以我想使用pymssql.
不过,当我尝试运行时遇到了这个问题pip install pymssql。
错误如下。
Using cached pymssql-2.2.2.tar.gz (170 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pymssql
Building wheel for pymssql (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
Your project path and someinfo about it.
Complete output (25 lines):
setup.py: platform.system() => Darwin
setup.py: platform.architecture() => ('64bit', '')
setup.py: platform.libc_ver() => …Run Code Online (Sandbox Code Playgroud) 我正在使用 python 诗歌,要了解它请参阅。
\n安装时我没有遇到任何问题,命令。
\nPoetry 能够安装这些软件包,但它被卡在中间了。
\n我尝试做堆栈溢出和谷歌上存在的多种解决方案。再次没有任何作用。
\n现在我收到以下错误:
(.venv) PS C:\\Project_File\\backend> poetry install\nInstalling dependencies from lock file\n\n ParseConstraintError \n \n Could not parse version constraint: install \n \n at ~\\AppData\\Roaming\\pypoetry\\venv\\lib\\site-packages\\poetry\\core\\semver\\__init__.py:149 in parse_single_constraint\n 145\xe2\x94\x82 return VersionUnion(VersionRange(max=version), VersionRange(min=version)) \n 146\xe2\x94\x82 else: \n 147\xe2\x94\x82 return version \n 148\xe2\x94\x82 \n \xe2\x86\x92 149\xe2\x94\x82 raise ParseConstraintError( \n 150\xe2\x94\x82 "Could not parse version constraint: {}".format(constraint) \n 151\xe2\x94\x82 ) \n 152\xe2\x94\x82 \nRun Code Online (Sandbox Code Playgroud)\n我在堆栈溢出上发现了一些相关的错误问题:\n Could not parse versionconstraint ~xx: Invalid version string "~xx" …
python ×4
macos ×3
apple-m1 ×2
python-3.x ×2
windows ×2
h5py ×1
numpy ×1
pip ×1
pycharm ×1
pymssql ×1
python-wheel ×1
subprocess ×1
virtualenv ×1