New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in cryptography setup command: Invalid environment marker: python_version < '3' #31741

Closed
mg0314a opened this Issue Oct 14, 2017 · 18 comments

Comments

Projects
None yet
@mg0314a

mg0314a commented Oct 14, 2017

Hi there,
The team at stresisand effect suggested that I open an issue here. I am receiving the following error when installing ansible:
error in cryptography setup command: Invalid environment marker: python_version < '3'

My system is Ubuntu 16.04 LTS

My python is:
python --version
Python 2.7.6

I also have python 3.4.0 on my system.

Should I make an python alias so that it python defaults to python 3.4.0? But I think my streisandeffect install might need python 2.x to work. Thank you.

ISSUE TYPE
  • Bug Report
CONFIGURATION
OS / ENVIRONMENT

Ubuntu 16.04 LTS

SUMMARY
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS

@ansibot

This comment has been minimized.

Show comment
Hide comment
@ansibot

ansibot Oct 14, 2017

Contributor

@mg0314a Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.

Here are the items we could not find in your description:

  • ansible version
  • component name

Please set the description of this issue with this template:
https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE.md

click here for bot help

Contributor

ansibot commented Oct 14, 2017

@mg0314a Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.

Here are the items we could not find in your description:

  • ansible version
  • component name

Please set the description of this issue with this template:
https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE.md

click here for bot help

@sivel

This comment has been minimized.

Show comment
Hide comment
@sivel

sivel Oct 14, 2017

Member

This is not a problem with ansible, and as the error mentions, this is with the cryptography python module. The resolution however is to update your version of python setuptools.

Should you want to open an issue, you would need to do so with https://github.com/pyca/cryptography

If you have further questions please stop by IRC or the mailing list:

Member

sivel commented Oct 14, 2017

This is not a problem with ansible, and as the error mentions, this is with the cryptography python module. The resolution however is to update your version of python setuptools.

Should you want to open an issue, you would need to do so with https://github.com/pyca/cryptography

If you have further questions please stop by IRC or the mailing list:

@sivel sivel closed this Oct 14, 2017

@sivel sivel removed the needs_triage label Oct 14, 2017

@mg0314a

This comment has been minimized.

Show comment
Hide comment
@mg0314a

mg0314a Oct 15, 2017

Ok I can open an issue at https://github.com/pyca/cryptography. But FYI updating my version of python setuptools does not work, it produces this error:

distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip_build_root/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-GkaN6_-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/cryptography
Storing debug log for failure in /root/.pip/pip.log

Here is the exception information from pip.log:

Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 707, in install
cwd=self.source_dir, filter_stdout=self.filter_install, show_stdout=False)
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 715, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip_build_root/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-GkaN6
-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/cryptography

mg0314a commented Oct 15, 2017

Ok I can open an issue at https://github.com/pyca/cryptography. But FYI updating my version of python setuptools does not work, it produces this error:

distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip_build_root/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-GkaN6_-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/cryptography
Storing debug log for failure in /root/.pip/pip.log

Here is the exception information from pip.log:

Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 707, in install
cwd=self.source_dir, filter_stdout=self.filter_install, show_stdout=False)
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 715, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip_build_root/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-GkaN6
-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/cryptography

@azenakhi

This comment has been minimized.

Show comment
Hide comment
@azenakhi

azenakhi Oct 16, 2017

You can try that:

  • Red Hat Enterprise Linux Server release 7.3 (Maipo)
  • Python 2.7.5

$ virtualenv ansible
$ source ansible/bin/activate

$ pip install --upgarde setuptools
$ pip install cffi
$ pip install ansible

Best regards

azenakhi commented Oct 16, 2017

You can try that:

  • Red Hat Enterprise Linux Server release 7.3 (Maipo)
  • Python 2.7.5

$ virtualenv ansible
$ source ansible/bin/activate

$ pip install --upgarde setuptools
$ pip install cffi
$ pip install ansible

Best regards

@petersohn

This comment has been minimized.

Show comment
Hide comment
@petersohn

petersohn Oct 18, 2017

I encountered the same problem when trying to install the cryptography package in a completely different environment. Under Ubuntu Trusty, Python 2.7.5 and pip 1.5.4, I get the same error message. However, under Ubuntu Xenial, Python 2.7.12 and pip 8.1.1, cryptography can be installed successfully.

petersohn commented Oct 18, 2017

I encountered the same problem when trying to install the cryptography package in a completely different environment. Under Ubuntu Trusty, Python 2.7.5 and pip 1.5.4, I get the same error message. However, under Ubuntu Xenial, Python 2.7.12 and pip 8.1.1, cryptography can be installed successfully.

@2rs2ts

This comment has been minimized.

Show comment
Hide comment
@2rs2ts

2rs2ts Oct 18, 2017

I had the same problem in Debian Jessie. This is what I did to get it working for me:

sudo pip install --upgrade setuptools
sudo apt-get install libffi-dev libssl-dev

After this I was able to install ansible (2.4.0.0)

2rs2ts commented Oct 18, 2017

I had the same problem in Debian Jessie. This is what I did to get it working for me:

sudo pip install --upgrade setuptools
sudo apt-get install libffi-dev libssl-dev

After this I was able to install ansible (2.4.0.0)

@petersohn

This comment has been minimized.

Show comment
Hide comment
@petersohn

petersohn Oct 19, 2017

It seems that the problem is with old pip versions. Installing the newest version from bootstrap.pypa.io eliminates the problem.

petersohn commented Oct 19, 2017

It seems that the problem is with old pip versions. Installing the newest version from bootstrap.pypa.io eliminates the problem.

@lalzada

This comment has been minimized.

Show comment
Hide comment
@lalzada

lalzada Oct 22, 2017

@petersohn that did the trick.. thanks..

lalzada commented Oct 22, 2017

@petersohn that did the trick.. thanks..

@geerlingguy

This comment has been minimized.

Show comment
Hide comment
@geerlingguy

geerlingguy Oct 23, 2017

Contributor

@petersohn - in my case, I was having trouble even if installing the latest pip (pip install --upgrade pip); I still had to upgrade setuptools following @2rs2ts's advice in #31741 (comment) (for Debian 8/Jessie). Thanks!

Contributor

geerlingguy commented Oct 23, 2017

@petersohn - in my case, I was having trouble even if installing the latest pip (pip install --upgrade pip); I still had to upgrade setuptools following @2rs2ts's advice in #31741 (comment) (for Debian 8/Jessie). Thanks!

@prinsherbert

This comment has been minimized.

Show comment
Hide comment
@prinsherbert

prinsherbert Oct 27, 2017

If the problem is with an outdated setuptools or pip, then please add the correct setuptools and pip version requirements to setup.py.

prinsherbert commented Oct 27, 2017

If the problem is with an outdated setuptools or pip, then please add the correct setuptools and pip version requirements to setup.py.

@grvtechno

This comment has been minimized.

Show comment
Hide comment
@grvtechno

grvtechno Nov 5, 2017

Command python setup.py egg_info failed with error code 1 in /usr/src/p2pool/.pyenv/build/cryptography

grvtechno commented Nov 5, 2017

Command python setup.py egg_info failed with error code 1 in /usr/src/p2pool/.pyenv/build/cryptography

@grvtechno

This comment has been minimized.

Show comment
Hide comment
@grvtechno

grvtechno Nov 5, 2017

can anyone help me with above error..?

grvtechno commented Nov 5, 2017

can anyone help me with above error..?

@isolationism

This comment has been minimized.

Show comment
Hide comment
@isolationism

isolationism Nov 13, 2017

@grvtechno did you try running pip install --upgrade pip?

isolationism commented Nov 13, 2017

@grvtechno did you try running pip install --upgrade pip?

@draeath

This comment has been minimized.

Show comment
Hide comment
@draeath

draeath Nov 14, 2017

Reminder, the above needs to be done using the virtualenv's pip.

If you still have problems grvtechno, please ask here as that is occurring in the pyenv build process.

draeath commented Nov 14, 2017

Reminder, the above needs to be done using the virtualenv's pip.

If you still have problems grvtechno, please ask here as that is occurring in the pyenv build process.

atzannes added a commit to atzannes/heroku-buildpack-python-old that referenced this issue Dec 18, 2017

Upgrade pip and setuptools before install
To avoid problems such as
ansible/ansible#31741
we want to have the latest pip and setuptools.
@luisco

This comment has been minimized.

Show comment
Hide comment
@luisco

luisco Jan 17, 2018

Thanks azenakhi ,

pip install --upgrade setuptools

work for me!!

luisco commented Jan 17, 2018

Thanks azenakhi ,

pip install --upgrade setuptools

work for me!!

@aquasan

This comment has been minimized.

Show comment
Hide comment
@aquasan

aquasan Jan 17, 2018

Thanks @azenakhi
pip install --upgrade setuptools
export CPPFLAGS=-I/usr/local/opt/openssl/include
export LDFLAGS=-L/usr/local/opt/openssl/lib
worked for me!

aquasan commented Jan 17, 2018

Thanks @azenakhi
pip install --upgrade setuptools
export CPPFLAGS=-I/usr/local/opt/openssl/include
export LDFLAGS=-L/usr/local/opt/openssl/lib
worked for me!

CodeLenny added a commit to CodeLenny/orientdb-role that referenced this issue Jan 20, 2018

@darklord1990

This comment has been minimized.

Show comment
Hide comment
@darklord1990

darklord1990 Jan 22, 2018

Thanks @azenakhi

It worked on SUSE Linux Enterprise Server 12

darklord1990 commented Jan 22, 2018

Thanks @azenakhi

It worked on SUSE Linux Enterprise Server 12

@radzhome

This comment has been minimized.

Show comment
Hide comment
@radzhome

radzhome Mar 12, 2018

To fix on CentOS 7 I did:

sudo pip install --upgrade setuptools
sudo pip install --upgrade ndg-httpsclient

radzhome commented Mar 12, 2018

To fix on CentOS 7 I did:

sudo pip install --upgrade setuptools
sudo pip install --upgrade ndg-httpsclient

atzannes added a commit to AltSchool/heroku-buildpack-python that referenced this issue Aug 22, 2018

Upgrade pip and setuptools before install
To avoid problems such as
ansible/ansible#31741
we want to have the latest pip and setuptools.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment