我想在 VsCode 中使用 pip 安装 fastapi
pip install fastapi[all]
Run Code Online (Sandbox Code Playgroud)
但我遇到了这个巨大的错误。我究竟做错了什么?
ERROR: Command errored out with exit status 1:
command: 'C:\Users\krish\Desktop\Codes\API\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\krish\\AppData\\Local\\Temp\\pip-install-eqmneh6a\\httptools_b8491d7c29264d1c9eb72c9367d56d7a\\setup.py'"'"'; __file__='"'"'C:\\Users\\krish\\AppData\\Local\\Temp\\pip-install-eqmneh6a\\httptools_b8491d7c29264d1c9eb72c9367d56d7a\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\krish\AppData\Local\Temp\pip-record-wvba_iw2\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\krish\Desktop\Codes\API\venv\include\site\python3.10\httptools'
cwd: C:\Users\krish\AppData\Local\Temp\pip-install-eqmneh6a\httptools_b8491d7c29264d1c9eb72c9367d56d7a\
Complete output (25 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
creating build\lib.win-amd64-3.10\httptools
copying httptools\_version.py -> build\lib.win-amd64-3.10\httptools
copying httptools\__init__.py …Run Code Online (Sandbox Code Playgroud) 我想知道在哪些情况pipwin下我可以使用pip?我知道 pip 是标准。
来自 pipwin 它指出
pipwin 与 pip 类似,但它安装 Christoph Gohlke 提供的预编译 Windows 二进制文件。
如果我们在打包成 EXE 后与其他人共享我们的程序 - 使用 Windows,这是否有任何优势?
我遇到了 PIL 问题,vs code 说没有名为 PIL 的模块,而实际上存在。如果我在没有 vs code 的情况下运行该文件,则模块导入正常。在 vs code 的问题选项卡中它是这样说的:
import PIL could not be resolved from source. Pylance(reportmissingmodulesource)
Run Code Online (Sandbox Code Playgroud)
我知道该库已安装,因为如果我安装了pip install pillow,它会说要求已经满足。
我尝试解决的问题:重新安装 python、卸载并重新安装pillow、升级 pip、安装 PIL 库(pip install Pillow-PIL)。
这些方法都不起作用,所以我没有尝试的想法。有人可以帮我解决这个问题吗?
以下内容位于requirements.txt中:
requirements.txt:packaging==20.9
Run Code Online (Sandbox Code Playgroud)
但在做了之后,我们现在在诗歌.lockpoetry add [some unrelated pkg] 中有:
{文件=“packaging-21.3.tar.gz”,散列=“sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb”},
这对我们不起作用。怎样才能得到诗歌听的requirements.txt?
pip freeze > requirements.txt
Run Code Online (Sandbox Code Playgroud)
我使用此命令生成一些要求,但结果带有一些本地文件位置。如何避免它们?
absl-py @ file:///home/conda/feedstock_root/build_artifacts/absl-py_1637088766493/work
aiohttp @ file:///D:/bld/aiohttp_1637087223487/work
aiosignal @ file:///home/conda/feedstock_root/build_artifacts/aiosignal_1636093929600/work
albumentations==1.1.0
async-timeout @ file:///home/conda/feedstock_root/build_artifacts/async-timeout_1637092647930/work
attrs @ file:///home/conda/feedstock_root/build_artifacts/attrs_1620387926260/work
autopep8==1.6.0
backcall==0.2.0
Run Code Online (Sandbox Code Playgroud)
我不想要的“@file:///home/conda/feedstock_root/build_artifacts/attrs_1620387926260/work”。
我收到此错误:
At line:1 char:1
+ playwright install
+ ~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (playwright:String) [],CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Run Code Online (Sandbox Code Playgroud)
我使用 pip 安装它,以便在 python 中使用
当我安装 psyxopg2 时,出现以下错误。有谁能帮我解决一下吗...
\nCollecting psycopg2\n\n Using cached psycopg2-2.9.3.tar.gz (380 kB)\n\n Preparing metadata (setup.py) ... done\n\nBuilding wheels for collected packages: psycopg2\n\n Building wheel for psycopg2 (setup.py) ... error\n\n error: subprocess-exited-with-error\n\n \n\n \xc3\x97 python setup.py bdist_wheel did not run successfully.\n\n \xe2\x94\x82 exit code: 1\n\n \xe2\x95\xb0\xe2\x94\x80> [40 lines of output]\n\n /home/vedvund/PycharmProjects/postgreSQLDatabaseusingPython /venv/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.\n\n warnings.warn(msg, warning_class)\n\n running bdist_wheel\n\n running build\n\n running build_py\n\n creating build\n\n creating build/lib.linux-x86_64-cpython-310\n\n creating build/lib.linux-x86_64-cpython-310/psycopg2\n\n copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-310/psycopg2\n\n copying lib/__init__.py -> …Run Code Online (Sandbox Code Playgroud) 我有一个包含存储库的 pip 安装要求的文件(requirements.txt)。为了进行测试,我有另一个文件(requirements_tests.txt),它应该包含相同的要求和更多内容。我可以从requirements_tests.txt中引用requirements.txt吗?
我注意到 docker 镜像可能会很大,因为将 pip 缓存保存在/root/.cache/pip. 我知道在我的 docker 映像中安装了所有依赖项后,我可以删除此目录。我不确定这与 docker 的 BuildKit 有什么关系,它允许使用缓存更快地安装。这两者有某种关联吗?那么,如果我想从 BuildKit 中受益,删除它是否安全/root/.cache/pip?我的问题是由大量的Python依赖项(例如torch和nvidia)引起的,它们可能占用几GB。删除 pip 缓存可能会将图像的大小减少 2-3 GB。
我通过 pip 安装 rasa 时遇到错误。错误信息如下所示,似乎提示我的Python版本不适用,但我的Python版本是3.11.3,肯定是在3.4以上。有人对这可能是什么有什么建议吗?
\nCollecting rasa\n Using cached rasa-1.10.2-py3-none-any.whl (510 kB)\nCollecting PyJWT<1.8,>=1.7 (from rasa)\n Using cached PyJWT-1.7.1-py2.py3-none-any.whl (18 kB)\nRequirement already satisfied: SQLAlchemy<1.4.0,>=1.3.3 in c:\\users\\ayu\\appdata\\roaming\\python\\python311\\site-packages (from rasa) (1.3.24)\nCollecting absl-py<0.10,>=0.9 (from rasa)\n Using cached absl-py-0.9.0.tar.gz (104 kB)\n Preparing metadata (setup.py) ... error\n error: subprocess-exited-with-error\n\n \xc3\x97 python setup.py egg_info did not run successfully.\n \xe2\x94\x82 exit code: 1\n \xe2\x95\xb0\xe2\x94\x80> [6 lines of output]\n Traceback (most recent call last):\n File "<string>", line 2, in <module>\n File "<pip-setuptools-caller>", line 34, in <module>\n File "C:\\Users\\albertgranz\\App\\Local\\Temp\\pip-install-ctiigi8b\\absl-py_f74b78151a764aaaabe5f2a103d08a3d\\setup.py", …Run Code Online (Sandbox Code Playgroud)