Can't install python module with Dockerfile - python

I am unable to install Flask-User from my requirements file as when it comes to that module I get the error:
Collecting bcrypt>=2.0 (from flask-user->-r requirements.txt (line 8))
Downloading https://files.pythonhosted.org/packages/ce/3a/3d540b9f5ee8d92ce757eebacf167b9deedb8e30aedec69a2a072b2399bb/bcrypt-3.1.6.tar.gz (42kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
Complete output from command /usr/local/bin/python /usr/local/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-vtowffrv/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel "cffi>=1.1; python_implementation != 'PyPy'":
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/82/9c/e812a9838feaf76cd9a960ca4ced3be7f2db31e473677a621d006e128db2/setuptools-40.7.3-py2.py3-none-any.whl (574kB)
Collecting wheel
Downloading https://files.pythonhosted.org/packages/ff/47/1dfa4795e24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3-none-any.whl
Collecting cffi>=1.1
Downloading https://files.pythonhosted.org/packages/e7/a7/4cd50e57cc6f436f1cc3a7e8fa700ff9b8b4d471620629074913e3735fb2/cffi-1.11.5.tar.gz (438kB)
Complete output from command python setup.py egg_info:
No working compiler found, or bogus compiler options passed to
the compiler from Python's standard "distutils" module. See
the error messages above. Likely, the problem is not related
to CFFI but generic to the setup.py of any Python package that
tries to compile C code. (Hints: on OS/X 10.8, for errors about
-mno-fused-madd see http://stackoverflow.com/questions/22313407/
Otherwise, see https://wiki.python.org/moin/CompLangPython or
the IRC channel #python on irc.freenode.net.)
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-wt1ra3xd/cffi/
----------------------------------------
Command "/usr/local/bin/python /usr/local/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-vtowffrv/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel "cffi>=1.1; python_implementation != 'PyPy'"" failed with error code 1 in None
ERROR: Service 'frontend' failed to build: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1
I have tried to upgrade pip, and install setuptools to no avail.
This is my dockerfile:
FROM python:3.6-alpine
WORKDIR /app
COPY requirements.txt /app
COPY app.py /app
COPY templates /app/templates
RUN pip install -r requirements.txt
EXPOSE 5000
ENTRYPOINT ["python"]
CMD ["app.py"]
requirements.txt:
Flask
requests
jsonify
pymongo
request
wtforms
flask-mongoengine
flask-user
Edit:
Appears gcc is not included in the alpine base image.
I resolved this issue by using FROM python:3.6-slim instead.

Appears gcc is not included in the alpine base image. I resolved this issue by using FROM python:3.6-slim instead.

Related

Unable to install cryptography and PyInstaller

I'm getting below error while installing the cryptography and PyInstaller packages. I have already installed setuptools==54.0.0 (tried 66.1.1 and 65.3.0 versions also). cffi==1.15.1 and setuptools-rust==1.5.2.
ERROR: Command errored out with exit status 1: 'C:\Program Files\Python39\python.exe' 'C:\Users{userid}\AppData\Local\Temp\pip-standalone-pip-cpesje2d_env_pip_.zip\pip' install --ignore-installed --no-user --prefix 'C:\Users{userid}\AppData\Local\Temp\pip-build-env-yhp_bywu\overlay' --no-warn-script-location --no-binary :none: --no-index -- 'setuptools>=40.6.0, ! =60.9.0' wheel 'cffi>=1.12; platform_python_implementation! = '"'"'PyPy'"'"'' 'setuptools-rust>=0.11.4'
I want help to install these 2 packages as I can install other packages

pip cannot find build dependencies

I am trying to install some python libraries using
pip install -r requirements
The file looks like:
spacy>=2.1.0,<2.2.0
matplotlib
pandas
networkx
flask
inflect
It was initially giving errors for C++ build tools, but after installing those using the visual studio installer I get the following error.
Collecting spacy<2.2.0,>=2.1.0
Using cached spacy-2.1.9.tar.gz (30.7 MB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\haris\AppData\Local\Programs\Python\Python38\python.exe'
'C:\Users\haris\AppData\Local\Temp\pip-standalone-pip-iges9uxt\__env_pip__.zip\pip' install --ignore-installed --no-user --prefix
'C:\Users\haris\AppData\Local\Temp\pip-build-env-49g1awc5\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'wheel>0.32.0,<0.33.0' Cython 'cymem>=2.0.2,<2.1.0' 'preshed>=2.0.1,<2.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=7.0.8,<7.1.0'
cwd: None
ERROR: Failed building wheel for blis
Running setup.py clean for blis
Successfully built preshed
Failed to build blis
Do I need to reinstall a newer version of python?

Install TensorFlow Object Detection on Windows Problems

I am trying to install Tensor Flow Object Detection on Windows 10.
Resource: https://towardsdatascience.com/how-to-install-tensorflow-2-object-detection-api-on-windows-2eef9b7ae869
After running these steps, we are receiving the errors below. It is stalling on pyarrow.
How can this be fixed?
protoc object_detection/protos/*.proto --python_out=.
python -m pip install .
Error: Collecting pyarrow<3.0.0,>=0.15.1
Using cached pyarrow-2.0.0.tar.gz (58.9 MB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\joe.k.smith\AppData\Local\Programs\Python\Python39\python.exe' 'C:\Users\joe.k.smith\AppData\Local\Programs\Python\Python39\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\joe.k.smith\AppData\Local\Temp\pip-build-env-b29td69q\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'cython >= 0.29' 'numpy==1.14.5; python_version<'"'"'3.7'"'"'' 'numpy==1.16.0; python_version>='"'"'3.7'"'"'' setuptools setuptools_scm wheel
cwd: None
Complete output (1950 lines):
Ignoring numpy: markers 'python_version < "3.7"' don't match your environment
Collecting cython>=0.29
Using cached Cython-0.29.23-cp39-cp39-win_amd64.whl (1.7 MB)
Collecting numpy==1.16.0
Additional Resources:
https://medium.com/riow/tensorflow-object-detection-on-windows-ad10bfde217c
I'm not exactly sure about that error, but for Tensorflow in general, if you go to this page, you'll see that, as of this writing, the only supported version of python are 3.6 - 3.8. It sounds like for tensorflow/models, you might do well to use 3.7. You will want to make sure you have a compatible version of pip as well.

pip install pymsgbox offline always failed

I need to publish my python app on windows with offline install, but it fails when install pymsgbox:
c:\Users\admin\Desktop\python3\pip>pip3.6 install --no-index --find-links=.\ pymsgbox==1.0.9
Looking in links: .
Collecting pymsgbox==1.0.9
Installing build dependencies ... error
Complete output from command "c:\program files\python36\python.exe" -m pip install --ignore-installed --no-user --prefix C:\Users\admin\AppData\Local\Temp\pip-build-env-gahbccbj --no-warn-script-location --no-binary :none: --only-binary :none: --no-index --find-links .\ -- setuptools>=38.2.5 wheel:
Looking in links: .
Collecting setuptools>=38.2.5
Collecting wheel
Could not find a version that satisfies the requirement wheel (from versions: )
No matching distribution found for wheel
Command ""c:\program files\python36\python.exe" -m pip install --ignore-installed --no-user --prefix C:\Users\admin\AppData\Local\Temp\pip-build-env-gahbccbj --no-warn-script-location --no-binary :none: --only-binary :none: --no-index --find-links .\ -- setuptools>=38.2.5 wheel" failed with error code 1 in None
I have already install setuptools>=38.2.5
c:\Users\admin\Desktop\python3\pip>pip3.6 list | findstr setuptools
setuptools 42.0.2
If I install pymsgbox online, it success:
c:\Users\admin\Desktop\python3\pip>pip3.6 install pymsgbox==1.0.9 -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pymsgbox==1.0.9
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/7d/ff/4c6f31a4f08979f12a663f2aeb6c8b765d3bd592e66eaaac445f547bb875/PyMsgBox-1.0.9.tar.gz
Installing build dependencies ... done
Installing collected packages: pymsgbox
Running setup.py install for pymsgbox ... done
Successfully installed pymsgbox-1.0.9
Why it requires setuptools while already satisfied?

Error During installing this library " pip install bcrypt" in django

I got an error while installing bcrypt in Django
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\Hassan\AppData\Local\Temp\pip-install-w128k6kc\cffi\
----------------------------------------
Command "C:\Users\Hassan\PycharmProjects\django_level_5\venv\Scripts\python.exe
C:\Users\Hassan\PycharmProjects\django_level_5\venv\lib\site-packages\pip-19.0.3-py
3.8.egg\pip install --ignore-installed --no-user --prefix C:\Users\Hassan\AppData\Local\Temp\pip-build-env-ky7v9nxx\overlay
--no-warn-script-location --no-binary :
none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=40.8.0 wheel "cffi>=1.1; python_implementation != 'PyPy'""
failed with error code 1 in None
Apply these three commands
pip uninstall bcrypt cffi pycparser
pip install --user --upgrade cffi
pip install --user --upgrade bcrypt
if this error is show
microsoft visual c++ 14.0 is required
then you have to download vs_buildtools after installing and
enter these above commmands again

Categories

Resources