ModuleNotFoundError:将python应用程序推送到heroku时,没有名为“ Xlib”的模块

时间:2018-10-18 10:05:28

标签: python heroku

我想在Heroku上部署python应用程序,我已经尝试过pip install python3_xlibpip install --upgrade setuptools,但仍然无法解决错误:

(ll_env) C:\Users\lyj\Desktop\Python_journey_code\learning_log>git push heroku master
Counting objects: 49, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (41/41), done.
Writing objects: 100% (49/49), 11.77 KiB | 388.00 KiB/s, done.
Total 49 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote:  !     The latest version of Python 3.6 is python-3.6.6 (you are using python-3.6.5, which is unsupported).
remote:  !     We recommend upgrading by specifying the latest version (python-3.6.6).
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.6.5
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting bottle==0.12.13 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 1))
remote:          Downloading https://files.pythonhosted.org/packages/bd/99/04dc59ced52a8261ee0f965a8968717a255ea84a36013e527944dbf3468c/bottle-0.12.13.tar.gz (70kB)
remote:        Collecting certifi==2018.4.16 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 2))
remote:          Downloading https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl (150kB)
remote:        Collecting chardet==3.0.4 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 3))
remote:          Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
remote:        Collecting cycler==0.10.0 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 4))
   .......
remote:        Collecting matplotlib==2.2.2 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 11))
remote:          Downloading https://files.pythonhosted.org/packages/49/b8/89dbd27f2fb171ce753bb56220d4d4f6dbc5fe32b95d8edc4415782ef07f/matplotlib-2.2.2-cp36-cp36m-manylinux1_x86_64.whl (12.6MB)
remote:        Collecting numpy==1.14.2 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 12))
remote:          Downloading https://files.pythonhosted.org/packages/6e/dc/92c0f670e7b986829fc92c4c0208edb9d72908149da38ecda50d816ea057/numpy-1.14.2-cp36-cp36m-manylinux1_x86_64.whl (12.2MB)
remote:        Collecting Pillow==5.1.0 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 13))
remote:          Downloading https://files.pythonhosted.org/packages/5f/4b/8b54ab9d37b93998c81b364557dff9f61972c0f650efa0ceaf470b392740/Pillow-5.1.0-cp36-cp36m-manylinux1_x86_64.whl (2.0MB)
remote:        Collecting PyAutoGUI==0.9.36 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 14))
remote:          Downloading https://files.pythonhosted.org/packages/2e/83/89b5adbc37d1bbf7b486a2c1c00e8037e6f801e8c053c4897bb82d9510c6/PyAutoGUI-0.9.36.tar.gz (46kB)
remote:            Complete output from command python setup.py egg_info:
remote:            Traceback (most recent call last):
remote:              File "<string>", line 1, in <module>
remote:              File "/tmp/pip-build-dljfbbwj/PyAutoGUI/setup.py", line 6, in <module>
remote:                version=__import__('pyautogui').__version__,
remote:              File "/tmp/pip-build-dljfbbwj/PyAutoGUI/pyautogui/__init__.py", line 115, in <module>
remote:                from . import _pyautogui_x11 as platformModule
remote:              File "/tmp/pip-build-dljfbbwj/PyAutoGUI/pyautogui/_pyautogui_x11.py", line 7, in <module>
remote:                from Xlib.display import Display
remote:            ModuleNotFoundError: No module named 'Xlib'
remote:
remote:            ----------------------------------------
remote:        Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dljfbbwj/PyAutoGUI/
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to shielded-basin-12135.
remote:
To https://git.heroku.com/shielded-basin-12135.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/shielded-basin-12135.git'

1 个答案:

答案 0 :(得分:0)

对于python3,请尝试-

pip install python3-xlib