尝试使用以下命令从空项目创建轮子setup.py:
from setuptools import setup
setup(name='bla', version='1')
Run Code Online (Sandbox Code Playgroud)
我调用python setup.py bdist_wheel --python-tag py35 --plat-name linux_x86_64并得到
bla-1-py35-none-linux_x86_64.whl
python -V: Python 3.6.9
uname -p: x86_64
Run Code Online (Sandbox Code Playgroud)
我正在尝试从包含wheel档案的本地包目录中安装一些python要求。我正在Docker容器中安装需求。
我要执行的步骤是:
$ pip install wheel
# wheel runs, outputs .whl files to wheelhouse directory
$ pip wheel --wheel-dir wheelhouse -r requirements.txt
Run Code Online (Sandbox Code Playgroud)
然后,在我的Dockerfile:
ADD requirements.txt /tmp/requirements.txt
ADD wheelhouse /tmp/wheelhouse
# install requirements. Leave file in /tmp for now - may be useful.
RUN pip install --use-wheel --no-index --find-link /tmp/wheelhouse/ -r /tmp/requirements.txt
Run Code Online (Sandbox Code Playgroud)
这行得通-正确安装了所有要求:
# 'app' is the name of my built docker image
$ docker run app pip list
...
psycopg2 (2.5.1)
...
Run Code Online (Sandbox Code Playgroud)
但是,如果我真的尝试运行的容器里面的东西的用途 psycopg2,然后我得到如下: …
我在 Mac OSX 10.9.5 上使用 Python 2.7.10 运行 Anaconda。我正在尝试安装一个名为“Fiona”的软件包。
\n\n我进入了:
\n\nsudo pip install Fiona-1.6.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.ma\xe2\x80\x8c\xe2\x80\x8bcosx_10_10_intel.macosx_10_10_x86_64.whl \nRun Code Online (Sandbox Code Playgroud)\n\n结果:
\n\nThe directory \'/Users/ronaldbjork/Library/Caches/pip/http\' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo\'s -H flag. Fiona-1.6.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.mac\xe2\x80\x8c\xe2\x80\x8bosx_10_10_intel.macosx_10_10_x86_64.whl **is not a supported wheel on this platform.**\nRun Code Online (Sandbox Code Playgroud)\n\n建议使用 -H:
\n\n所以我输入:
\n\nsudo -H pip install …Run Code Online (Sandbox Code Playgroud) 我是python的新手。有人可以帮我解决tf-nightly和tensorflow轮之间的区别吗?
我应该安装什么?
https://pypi.python.org/pypi/tensorflow 与 https://pypi.python.org/pypi/tf-nightly
我被困在每晚的包裹里。我不知道那是什么
我正在编写一个yocto recipe应该从.whl文件安装 python 包的自定义。
我使用包含以下内容的食谱进行了尝试:
inherit pypi setuptools
PYPI_SRC_URI="http://ci.tensorflow.org/view/Nightly/job/nightly-pi-zero/lastSuccessfulBuild/artifact/output-artifacts/tensorflow-1.5.0rc1-cp27-none-any.whl“
Run Code Online (Sandbox Code Playgroud)
但它不能那样工作,它指出,setup.py文件丢失,并且在尝试编写do_compile运行pip install <PATH-TO-WHL>它的自定义任务时说,该 pip 是一个未知的命令。
将.whl文件直接安装到目标系统上时,将键入以下内容:
pip install <path-to-whl-file>
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助!
我正在尝试使用Docker使用此存储库为AWS Lambda创建依赖包,但每当我尝试运行build.sh文件时,我最终会得到以下消息:
没有这样的选择: - use-wheel
然后,当我尝试使用pip install wheel(在Docker之外)时,我被告知它已经在我的本地机器上,它就是这样.如何在Docker容器中安装Wheel?
如果它有用,这似乎是build.sh中提供问题的代码行:
test -f /outputs/requirements.txt && pip install --use-wheel -r /outputs/requirements.txt
Run Code Online (Sandbox Code Playgroud)
任何帮助深表感谢!
根据文档,tox 创建“通过调用当前项目的源代码分发python setup.py sdist”。
如何配置 tox 使其产生一个轮子,然后将其用于测试?:
python setup.py bdist_wheel --universal
Run Code Online (Sandbox Code Playgroud) 我已经准备好了 Python 脚本和 requirements.txt。
我想要做的是将“requirements.txt”中列出的所有包放入一个文件夹中。例如,在捆绑包中,我将拥有“pymysql”、“bs4”及其所有依赖项的完整包。
我完全不知道该怎么做。请问你能帮帮我吗?我被卡住了,我真的很挣扎。
我正在使用 Python 3.6
我正在使用“pip download -r requirements.txt”,但它没有下载依赖项并只输出我.whl 文件,而我正在寻找“正确的”文件夹..
在我的 setup.py 中,我在参数中指定了许多库required_libraries。这些通常采用以下形式:oauthlib==2.0.6。现在我还想使用远程 url 上托管的 Wheel 安装一个库:http://ci.tensorflow.org/view/Nightly/job/nightly-pi-zero/lastSuccessfulBuild/artifact/output-artifacts/tensorflow-1.4.0-cp27-none-any.whl。简单地将其添加为结果列表中的条目required_libraries会导致错误:
'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Invalid requirement,....
setuptools 的文档没有太大帮助。有人有进行此类安装的经验吗?我想这将是一个常见问题,但我可能在谷歌上搜索了错误的词
我们正在使用轮子将代码部署到 QA/生产。最近我们发现/意识到wheel包实际上存储了我们的源代码。通过下面的简单命令将打开其中的所有源代码。
unzip package.whl
Run Code Online (Sandbox Code Playgroud)
用于创建轮子的命令如下
cd /path/to/source/code/folder
python setup.py bdist bdist_wheel
Run Code Online (Sandbox Code Playgroud)
所以,
python-wheel ×10
python ×8
pip ×4
docker ×2
setuptools ×2
tensorflow ×2
abi ×1
cpython ×1
deployment ×1
dockerfile ×1
libraries ×1
macos ×1
psycopg2 ×1
pypi ×1
python-3.x ×1
recipe ×1
tox ×1
yocto ×1