首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用requirements.txt文件在Openshift python3.3墨盒上安装最新的python软件包

无法使用requirements.txt文件在Openshift python3.3墨盒上安装最新的python软件包
EN

Stack Overflow用户
提问于 2016-02-07 11:03:14
回答 1查看 751关注 0票数 1

当我将源代码推送到openshift python墨盒时,我会收到这条消息。

代码语言:javascript
复制
Could not find a version that satisfies the requirement requests==2.9.1

pip似乎找不到requirements.txt文件中指定的包版本,但它是最新版本,可以在package目录中找到。我如何强迫pip使用pypi索引而不是它现在使用的索引?

如何复制此错误:

代码语言:javascript
复制
rhc app-create py33 python-3.3
cd py33
touch requirements.txt
echo requests==2.9.1 >> requirements.txt
git add .
git commit -a -m "requests2.9.1"
git push

openshift服务器响应是:

代码语言:javascript
复制
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 274 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Stopping Python 3.3 cartridge
remote: Waiting for stop to finish
remote: Waiting for stop to finish
remote: Building git ref 'master', commit b6b983c
remote: Activating virtenv
remote: Checking for pip dependency listed in requirements.txt file..
remote: The directory '/var/lib/openshift/56b712f40c1e668ab20001a3/.cache/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.
remote: The directory '/var/lib/openshift/56b712f40c1e668ab20001a3/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
remote: Collecting requests==2.9.1 (from -r /var/lib/openshift/56b712f40c1e668ab20001a3/app-root/runtime/repo/requirements.txt (line 1))
remote:   Could not find a version that satisfies the requirement requests==2.9.1 (from -r /var/lib/openshift/56b712f40c1e668ab20001a3/app-root/runtime/repo/requirements.txt (line 1)) (from versions: 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.6.6, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 0.7.6, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8.7, 0.8.8, 0.8.9, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.10.0, 0.10.1, 0.10.2, 0.10.3, 0.10.4, 0.10.6, 0.10.7, 0.10.8, 0.11.1, 0.11.2, 0.12.0, 0.12.1, 0.13.0, 0.13.1, 0.13.2, 0.13.3, 0.13.4, 0.13.5, 0.13.6, 0.13.7, 0.13.8, 0.13.9, 0.14.0, 0.14.1, 0.14.2, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.8.0, 2.8.1)
remote: No matching distribution found for requests==2.9.1 (from -r /var/lib/openshift/56b712f40c1e668ab20001a3/app-root/runtime/repo/requirements.txt (line 1))
remote: Running setup.py script..
remote: running develop
remote: running egg_info
remote: creating YourAppName.egg-info
remote: writing YourAppName.egg-info/PKG-INFO
remote: writing dependency_links to YourAppName.egg-info/dependency_links.txt
remote: writing top-level names to YourAppName.egg-info/top_level.txt
remote: writing manifest file 'YourAppName.egg-info/SOURCES.txt'
remote: reading manifest file 'YourAppName.egg-info/SOURCES.txt'
remote: writing manifest file 'YourAppName.egg-info/SOURCES.txt'
remote: running build_ext
remote: Creating /var/lib/openshift/56b712f40c1e668ab20001a3/app-root/runtime/dependencies/python/virtenv/venv/lib/python3.3/site-packages/YourAppName.egg-link (link to .)
remote: Adding YourAppName 1.0 to easy-install.pth file
remote:
remote: Installed /var/lib/openshift/56b712f40c1e668ab20001a3/app-root/runtime/repo
remote: Processing dependencies for YourAppName==1.0
remote: Finished processing dependencies for YourAppName==1.0
remote: Preparing build for deployment
remote: Deployment id is 19c7fb7b
remote: Activating deployment
remote: Starting Python 3.3 cartridge (Apache+mod_wsgi)
remote: Application directory "/" selected as DocumentRoot
remote: Application "wsgi.py" selected as default WSGI entry point
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://56b712f40c1e668ab20001a3@py33-chaticha.rhcloud.com/~/git/py33.git/
   be50ea8..b6b983c  master -> master
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-02-13 12:19:52

更新:,在将此问题提交给openshift错误报告系统之后,他们解决了这个问题,现在一切都如期而至。

正如“武定”所说,造成这一问题的原因是:

我们确实为我们的PyPi系统维护了一面镜像。因此,有时,当一个新包在PyPi中出现时,我们的镜像将需要重新生成,在此期间,您提到的问题可能会发生。

他们不得不重新整合镜子来解决这个问题:

镜子已经被重新复制,我已经在我的一端测试了它。问题已经解决,您应该能够安装最新的版本请求。请试一试,让我们知道结果。

原来的答案:

我无法找到解决我所描述的问题的任何解决方案,因此目前我正在使用deploy操作钩子中的两行命令作为我的问题的临时修复:

代码语言:javascript
复制
echo "installing dependencies..."
pip install -r "$OPENSHIFT_REPO_DIR"requirements.txt
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35252649

复制
相关文章

相似问题

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