Can't install pyOpenSSL for Python 3 - python-3.x

I am running a Pyhon3 script that depends on OpenSSL and it depends on OpenSSL. However, I am having problems installing it.
# pip3 install pyOpenSSL
Downloading/unpacking pyOpenSSL
Downloading pyOpenSSL-17.4.0-py2.py3-none-any.whl (52kB): 52kB downloaded
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in /usr/lib/python3/dist-packages (from pyOpenSSL)
Downloading/unpacking cryptography>=1.9 (from pyOpenSSL)
Downloading cryptography-2.1.3.tar.gz (441kB): 441kB downloaded
Running setup.py (path:/tmp/pip-build-ljoosnix/cryptography/setup.py) egg_info for package cryptography
error in cryptography setup command: Invalid environment marker: python_version < '3'
Complete output from command python setup.py egg_info:
error in cryptography setup command: Invalid environment marker: python_version < '3'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-ljoosnix/cryptography
Storing debug log for failure in /root/.pip/pip.log
I'm not sure what that "Invalid environment marker" means. Does it mean I can't install this for Python 3?
This is for a Debian 8 VM.

Try to run sudo apt-get install libssl-dev
Upd:
Try to run sudo pip3 install --upgrade pip

Related

distutils.errors.DistutilsError: Command . . . returned non-zero exit status 1 [duplicate]

Here are the commands I am running:
$ python setup.py bdist_wheel
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
$ pip --version
pip 1.5.6 from /usr/local/lib/python3.4/site-packages (python 3.4)
$ python -c "import setuptools; print(setuptools.__version__)"
2.1
$ python --version
Python 3.4.1
$ which python
/usr/local/bin/python
Also, I am running a mac with homebrewed python
Here is my setup.py script:
https://gist.github.com/cloudformdesign/4791c46fe7cd52eb61cd
I'm going absolutely crazy -- I can't figure out why this wouldn't be working.
Install the wheel package first:
pip install wheel
The documentation isn't overly clear on this, but "the wheel project provides a bdist_wheel command for setuptools" actually means "the wheel package...".
I also ran into the error message invalid command 'bdist_wheel'
It turns out the package setup.py used distutils rather than setuptools.
Changing it as follows enabled me to build the wheel.
#from distutils.core import setup
from setuptools import setup
Update your setuptools, too.
pip install setuptools --upgrade
If that fails too, you could try with additional --force flag.
I also ran into this all of a sudden, after it had previously worked, and it was because I was inside a virtualenv, and wheel wasn’t installed in the virtualenv.
Update your pip first:
pip install --upgrade pip
for Python 3:
pip3 install --upgrade pip
Throwing in another answer: Try checking your PYTHONPATH.
First, try to install wheel again:
pip install wheel
This should tell you where wheel is installed, eg:
Requirement already satisfied: wheel in /usr/local/lib/python3.5/dist-packages
Then add the location of wheel to your PYTHONPATH:
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.5/dist-packages/wheel
Now building a wheel should work fine.
python setup.py bdist_wheel
It could also be that you have a python3 system only.
You therefore have installed the necessary packages via pip3 install , like pip3 install wheel.
You'll need to build your stuff using python3 specifically.
python3 setup.py sdist
python3 setup.py bdist_wheel
Cheers.
I tried everything said here without any luck, but found a workaround.
After running this command (and failing) : bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
Go to the temporary directory the tool made (given in the output of the last command), then execute python setup.py bdist_wheel. The .whl file is in the dist folder.

Can't install Darts / llvmlite on Mac Python 3.8.9

Hello im having a real hard time installing darts in Python
Thanks in advance.
Running setup.py install for llvmlite ... error
error: subprocess-exited-with-error
× Running setup.py install for llvmlite did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
running install
/opt/homebrew/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
got version from file /private/var/folders/m4/g2pdxhsd7dn2652ll8d9sz3c0000gn/T/pip-install-fza_0yk5/llvmlite_dc59eabdee5b435d8bd514c51e5c47db/llvmlite/_version.py {'version': '0.38.0', 'full': 'f0365b91ce1e1f74c68785c6d0067f32f89857d9'}
running build_ext
/opt/homebrew/opt/python#3.9/bin/python3.9 /private/var/folders/m4/g2pdxhsd7dn2652ll8d9sz3c0000gn/T/pip-install-fza_0yk5/llvmlite_dc59eabdee5b435d8bd514c51e5c47db/ffi/build.py
LLVM version... Traceback (most recent call last):
File "/private/var/folders/m4/g2pdxhsd7dn2652ll8d9sz3c0000gn/T/pip-install-fza_0yk5/llvmlite_dc59eabdee5b435d8bd514c51e5c47db/ffi/build.py", line 220, in
main()
File "/private/var/folders/m4/g2pdxhsd7dn2652ll8d9sz3c0000gn/T/pip-install-fza_0yk5/llvmlite_dc59eabdee5b435d8bd514c51e5c47db/ffi/build.py", line 214, in main
main_posix('osx', '.dylib')
File "/private/var/folders/m4/g2pdxhsd7dn2652ll8d9sz3c0000gn/T/pip-install-fza_0yk5/llvmlite_dc59eabdee5b435d8bd514c51e5c47db/ffi/build.py", line 134, in main_posix
raise RuntimeError(msg) from None
RuntimeError: Could not find a llvm-config binary. There are a number of reasons this could occur, please see: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#using-pip for help.
error: command '/opt/homebrew/opt/python#3.9/bin/python3.9' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> llvmlite
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Please try to install darts in mac version 12.5.1 as follows:
My python version is different. But hoping this procedure works for you:
For your information below is my requirement.txt:
protobuf==3.20.1
python-dateutil==2.8.2
elasticsearch==7.13.0
elasticsearch-dsl==7.4.0
Flask==1.1.4
flask_restplus==0.13.0
Werkzeug==0.16.1
python-json-logger==2.0.2
ecs-logging==2.0.0
omegaconf==2.1.1
mock==4.0.3
nltk==3.6.7
PyJWT==2.4.0
pytest==6.2.5
requests==2.27.1
scikit-learn==1.0.2
pandas==1.3.5
pandasql==0.7.3
xlrd==2.0.1
colorlog==6.6.0
darts==0.15.0
psutil==5.9.1
decorator==5.1.1
zulu==2.0.0
But for dart installation i was facing issue. I solved the issue by manually installing packages as follows:-
% python --version
Python 3.10.6
% pip install CMAKE
% pip install setuptools
% pip3 install gensim
% brew install lightgbm
% brew install cmake
% brew install libomp
% pip install httpstan
% pip install lightgbm
% pip install ipython
% pip install google-auth-oauthlib
% pip install filterpy
% pip install cmdstanpy
% pip install tensorboard
% pip install prophet
% pip install pmdarima
% pip install darts
% pip list | grep darts
darts 0.21.0

Japronto Installation failed in linux

I am seeing this error while running python3.5 -m pip install japronto
Downloading/unpacking japronto
Could not find any downloads that satisfy the requirement japronto
Cleaning up...
No distributions at all found for japronto

Unable to build scrapy based project due to invalid environment marker error

I am unable to build docker image with Ubuntu as base OS for one of my projects written few months ago using Scrapy. Its showing following dependency error -
Downloading/unpacking cryptography>=2.1.4 (from pyOpenSSL->Scrapy==1.4.0->-r /app/requirements.txt (line 3))
Running setup.py (path:/tmp/pip_build_root/cryptography/setup.py) egg_info for package cryptography
error in cryptography setup command: Invalid environment marker: platform_python_implementation != 'PyPy'
Complete output from command python setup.py egg_info:
error in cryptography setup command: Invalid environment marker: platform_python_implementation != 'PyPy'
As I have no control over Scrapy's dependencies and I have been using Scrapy 1.4.0, latest release, alongwith Python 3, I am not sure what are my options now?
Following is the command I use to install the dependencies
pip3 install -r requirements.txt
Following is what my requirements.txt looks like
lxml==3.8.0
psycopg2==2.7.3.1
Scrapy==1.4.0
Twisted==17.5.0
validators==0.12.0
tweepy==3.5.0
Update:
The build goes fine on a Mac machine as shown below while it doesn't work on a Ubuntu machine. Note: Even a successful build does warn about platform_python_implementation != "PyPy" as shown below -
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography>=2.1.4->pyOpenSSL->Scrapy==1.4.0->-r requirements.txt (line 3))
Downloading cffi-1.11.2-cp35-cp35m-macosx_10_6_intel.whl (240kB)
100% |████████████████████████████████| 245kB 623kB/s
Collecting asn1crypto>=0.21.0 (from cryptography>=2.1.4->pyOpenSSL->Scrapy==1.4.0->-r requirements.txt (line 3))
Downloading asn1crypto-0.23.0-py2.py3-none-any.whl (99kB)
100% |████████████████████████████████| 102kB 830kB/s
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=2.1.4->pyOpenSSL->Scrapy==1.4.0->-r requirements.txt (line 3))
Building wheels for collected packages: zope.interface, oauthlib
Running setup.py bdist_wheel for zope.interface ... done
Stored in directory: /Users/rahul/Library/Caches/pip/wheels/8b/39/98/0fcb72adfb12b2547273b1164d952f093f267e0324d58b6955
Running setup.py bdist_wheel for oauthlib ... done
Stored in directory: /Users/rahul/Library/Caches/pip/wheels/e5/46/f7/bb2fde81726295a13a71e3c6396d362ab408921c6562d6efc0
Successfully built zope.interface oauthlib
The issue was related to pip3 upgrade. One of the contributors to the package shared the tip here

Can't install mercurial package with pip under python-3.2

I try to install mercurial with pip package manager with command:
pip.exe install mercurial -I --install-option="--c2to3"
and get such error:
Downloading/unpacking mercurial
Running setup.py egg_info for package mercurial
setup.py with python3 needs --c2to3 (experimental)
Complete output from command python setup.py egg_info:
setup.py with python3 needs --c2to3 (experimental)
----------------------------------------
Command python setup.py egg_info failed with error code 1
How to pass "--c2to3" option to setup.py correctly via pip options?
System: Server2008R2 SP1, python-3.2.3(AMD64)
Mercurial isn't supported on Python 3.x. Install it under Python 2.7 (unless you want to help port it)

Resources