我在 Openshift Python 3 卡带上有一个 Pyramid 服务器,它不喜欢 Pandas 模块,但我不知道如何弄清楚为什么会这样。
在setup.py
中,使用参数install_requires
和一些模块(例如pyramid
,biopython
,numpy
),运行良好。但是当我添加pandas
时它失败了。这是推送期间的内容(✱ = 为了安全而添加的审查):
remote: Installing collected packages: six, python-dateutil, pytz, pandas
remote: Found existing installation: six 1.3.0
remote: Not uninstalling six at /opt/rh/python33/root/usr/lib/python3.3/site-packages, outside environment /var/lib/openshift/✱✱✱✱✱/python/virtenv/venv
remote: Running setup.py install for pandas: started
remote: Running setup.py install for pandas: still running...
remote: Running setup.py install for pandas: still running...
remote: Running setup.py install for pandas: still running...
remote: Running setup.py install for pandas: still running...
remote: Running setup.py install for pandas: still running...
remote: Running setup.py install for pandas: still running...
Connection to pedel2-matteoferla.rhcloud.com closed by remote host.
fatal: The remote end hung up unexpectedly
error: error in sideband demultiplexer
To ssh://pedel2-matteoferla.rhcloud.com/~/git/pedel2.git/
✱✱✱ master -> master
error: failed to push some refs to 'ssh://✱✱✱✱@pedel2-matteoferla.rhcloud.com/~/git/pedel2.git/'
添加 requirements.txt
文件不会影响它,因为当我 ssh 进入服务器并手动安装 pip 时也会出现权限问题。即 /var/lib/openshift
不是我的虚拟环境。
remote: Activating virtenv
remote: Checking for pip dependency listed in requirements.txt file..
remote: The directory '/var/lib/openshift/✱✱✱✱/.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.
虚拟 python 中的 Pip3 执行相同的操作。
cd /python/virtenv/venv/bin/
./pip3 install pandas
Easy_install 做得对,但没有权限,所以这种方法无论如何都是错误的。
pedel2-matteoferla.rhcloud.com bin]\> ./easy_install pandas
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 122] Disk quota exceeded: '/var/lib/openshift/✱✱✱✱/python/virtenv/venv/lib/python3.3/site-packages/test-easy-install-247598.write-test'
我认为我应该使用 setuptools 模块来解决问题。这意味着我需要从那里找出原因。但我被困住了。
编辑。这不是我的磁盘配额。
Matteos-Air-3:pedel2 matteo$ rhc show-app pedel2 --gears quota
Gear Cartridges Used Limit
------------------------ ---------- ------ -----
✱✱✱✱ python-3.3 268 MB 1 GB
最佳答案
我认为您有一些问题。
- 大小问题 - 很难重现。但也许我们不需要它(请参阅下面的详细信息)
- 现代 Pandas 版本与 Python 3.3 不兼容 - 请参阅 this
我建议您使用“随时可用”的发行版,例如已经预装了 numpy、pandas 等的 Anaconda。
除此之外 - 不要覆盖 systme Python - 它可能会导致其他问题。
就install Anaconda into a separate directory并在每次使用时设置 Anaconda 环境。
PS 或者你可以有 Anaconda as Docker
关于python - 我的 Pyramid 不喜欢 Pandas ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43963115/