简体   繁体   English

ERR IOError:[Errno 21]是目录:'/app/.heroku/python/lib/python2.7/site-packages/setuptools-20.3-py2.7.egg'

[英]ERR IOError: [Errno 21] Is a directory: '/app/.heroku/python/lib/python2.7/site-packages/setuptools-20.3-py2.7.egg'

I try to deploy a Flask app in python (python 2.7.10). 我尝试在python(python 2.7.10)中部署Flask应用程序。 It is a very easy app with requirements.txt 这是一个非常简单的应用程序,带有requirements.txt

  • Flask==0.10.1 烧瓶== 0.10.1
  • distribute==0.6.27 分配== 0.6.27
  • setuptools==20.3 setuptools == 20.3
  • scipy==0.17 scipy == 0.17
  • matplotlib==1.5.1 matplotlib == 1.5.1
  • pickleshare==0.7.2 pickleshare == 0.7.2
  • scikit-learn==0.17.1 scikit学习== 0.17.1
  • numpy==1.11.1 numpy == 1.11.1

The app worked locally. 该应用程序在本地运行。 I now try to deploy it on IBM Bluemix and after pasting the command 我现在尝试在粘贴命令后将其部署在IBM Bluemix上

sudo cf push app
sudo cf logs predict_population --recent

I have this error: 我有这个错误:

ERR Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-bPyipf/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-RwvTnr-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-bPyipf/distribute/ 2016-09-11T14:09:39.93+0300
[STG/0]      ERR Traceback (most recent call last): 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/bin/pip", line 9, in <module> 2016-09-11T14:09:39.93+0300
[STG/0]      ERR     load_entry_point('pip==8.1.1', 'console_scripts', 'pip')() 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/__init__.py", line 217, in main 2016-09-11T14:09:39.93+0300
[STG/0]      ERR     return command.main(cmd_args) 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/basecommand.py", line 246, in main 2016-09-11T14:09:39.93+0300
[STG/0]      ERR     pip_version_check(session) 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/utils/outdated.py", line 102, in pip_version_check 2016-09-11T14:09:39.93+0300
[STG/0]      ERR     installed_version = get_installed_version("pip") 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/utils/__init__.py", line 848, in get_installed_version 2016-09-11T14:09:39.93+0300
[STG/0]      ERR     working_set = pkg_resources.WorkingSet() 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 626, in __init__ 2016-09-11T14:09:39.93+0300
[STG/0]      ERR     self.add_entry(entry) 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 682, in add_entry 2016-09-11T14:09:39.93+0300
[STG/0]      ERR    for dist in find_distributions(entry, True): 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 2080, in find_eggs_in_zip 2016-09-11T14:09:39.93+0300
[STG/0]      ERR     if metadata.has_metadata('PKG-INFO'): 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 1610, in has_metadata 2016-09-11T14:09:39.93+0300
[STG/0]      ERR     return self.egg_info and self._has(self._fn(self.egg_info, name)) 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 1968, in _has 2016-09-11T14:09:39.93+0300
[STG/0]      ERR     return zip_path in self.zipinfo or zip_path in self._index() 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 1848, in zipinfo 2016-09-11T14:09:39.93+0300
[STG/0]      ERR     return self._zip_manifests.load(self.loader.archive) 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 1791, in load 2016-09-11T14:09:39.93+0300
[STG/0]      ERR     manifest = self.build(path) 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 1764, in build 2016-09-11T14:09:39.93+0300
[STG/0]      ERR     with ContextualZipFile(path) as zfile: 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 1813, in __new__ 2016-09-11T14:09:39.93+0300
[STG/0]      ERR     return zipfile.ZipFile(*args, **kwargs) 2016-09-11T14:09:39.93+0300
[STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/zipfile.py", line 756, in __init__ 2016-09-11T14:09:39.94+0300
[STG/0]      ERR     self.fp = open(file, modeDict[mode]) 2016-09-11T14:09:39.94+0300
[STG/0]      ERR IOError: [Errno 21] Is a directory: '/app/.heroku/python/lib/python2.7/site-packages/setuptools-20.3-py2.7.egg'

Solved ! 解决了 ! Instead of writing if name == "main": app.run() Just do port = os.getenv('PORT', PORT_NUMBER) if name == "main": app.run(host='0.0.0.0', port=int(port)) and it works ! 如果name ==“ main”而不是写:app.run()如果name ==“ main”则只做port = os.getenv('PORT',PORT_NUMBER):app.run(host ='0.0.0.0', port = int(port))并起作用!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何手动将文件夹复制到/app/.heroku/python/lib/python2.7/site-packages/? - How to manually copy folder to /app/.heroku/python/lib/python2.7/site-packages/? OSError:[Errno 2]没有这样的文件或目录:&#39;/usr/local/lib/python2.7/dist-packages/pyduino-0.0.0-py2.7.egg&#39; - OSError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/pyduino-0.0.0-py2.7.egg' 找不到:/lib/python2.7/site-packages/tensorflow/tensorboard/lib/svg/summary-icon.sv - Not found : /lib/python2.7/site-packages/tensorflow/tensorboard/lib/svg/summary-icon.sv 如何忽略〜/ .local / lib / python2.7 / site-packages中的python模块? - How to ignore python module in ~/.local/lib/python2.7/site-packages? “/lib/python2.7/site-packages/不支持.pth文件”在MacOS上安装pip - “/lib/python2.7/site-packages/ does NOT support .pth files” installing pip on MacOS ImportError:dlopen(/usr/local/lib/python2.7/site-packages/_geoslib.so - ImportError: dlopen(/usr/local/lib/python2.7/site-packages/_geoslib.so 如何在Linux下的/usr/local/lib/python2.7/site-packages下安装Pip - how to Install Pip under /usr/local/lib/python2.7/site-packages in Linux 没有VirtualEnv的Python2.7中的站点包 - Site-Packages in Python2.7 without VirtualEnv 当我尝试安装virtualenv时导致此错误的原因是什么? IOError:[Errno 13]权限被拒绝:&#39;/ Library /Python/2.7/site-packages/virtualenv.py&#39; - What's causing this error when I try and install virtualenv? IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv.py' 安装python settuptools时发生错误-没有这样的文件或目录:&#39;/usr/local/lib/python2.7/site-packages/test-easy-install-8811.pth&#39; - Error when installing python settuptools - No such file or directory: '/usr/local/lib/python2.7/site-packages/test-easy-install-8811.pth'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM