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

setuptools pkg_resources pip wheel failed with error code 1 #2883

Open
painhardcore opened this Issue Apr 22, 2016 · 24 comments

Comments

Projects
None yet
@painhardcore
./letsencrypt-auto --help
python is already the newest version (2.7.11-1).
python-dev is already the newest version (2.7.11-1).
dialog is already the newest version (1.3-20160209-1).
python-virtualenv is already the newest version (15.0.1+ds-3).
virtualenv is already the newest version (15.0.1+ds-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Checking for new version...
Creating virtual environment...
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/virtualenv.py", line 2363, in <module>
    main()
  File "/usr/lib/python3/dist-packages/virtualenv.py", line 719, in main
    symlink=options.symlink)
  File "/usr/lib/python3/dist-packages/virtualenv.py", line 988, in create_environment
    download=download,
  File "/usr/lib/python3/dist-packages/virtualenv.py", line 918, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/usr/lib/python3/dist-packages/virtualenv.py", line 812, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/administrator/...ncrypt/bin/python2.7 - setuptools pkg_resources pip wheel failed with error code 1

OS Ubuntu 16.04 LTS
Clean os

@vincentcox

This comment has been minimized.

Show comment
Hide comment
@vincentcox

vincentcox Apr 23, 2016

same issue!

same issue!

@vincentcox

This comment has been minimized.

Show comment
Hide comment
@vincentcox

vincentcox Apr 23, 2016

Some details: nginx installed and also php7.0 fpm, for the rest clean install

Some details: nginx installed and also php7.0 fpm, for the rest clean install

@vincentcox

This comment has been minimized.

Show comment
Hide comment
@vincentcox

vincentcox Apr 23, 2016

I solved it: just use "apt-get install letsencrypt". Super lame, but it works now

I solved it: just use "apt-get install letsencrypt". Super lame, but it works now

@joost-van-weenen

This comment has been minimized.

Show comment
Hide comment
@joost-van-weenen

joost-van-weenen Apr 30, 2016

Same issue on ubuntu 16.04 with the client from git

Same issue on ubuntu 16.04 with the client from git

@asibin

This comment has been minimized.

Show comment
Hide comment
@asibin

asibin May 1, 2016

I managed to get it working on Ubuntu 16.04 Server LTS. I deleted the apt-get installed setuptools, reinstalled with pip and it worked. If you get setuptools complaining about the locale, make sure you have locales set.

asibin commented May 1, 2016

I managed to get it working on Ubuntu 16.04 Server LTS. I deleted the apt-get installed setuptools, reinstalled with pip and it worked. If you get setuptools complaining about the locale, make sure you have locales set.

@kfchoong

This comment has been minimized.

Show comment
Hide comment
@kfchoong

kfchoong May 3, 2016

I resolved the issue by setting the locale variables. Without these, the script seems to break.
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"

kfchoong commented May 3, 2016

I resolved the issue by setting the locale variables. Without these, the script seems to break.
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"

@benbonnet

This comment has been minimized.

Show comment
Hide comment
@benbonnet

benbonnet Jun 8, 2016

For those who might have a look at it, and compared to other configuration tasks to be initially done on ubuntu, configuring locales seems opaque. Which guide could one recommend ?

For those who might have a look at it, and compared to other configuration tasks to be initially done on ubuntu, configuring locales seems opaque. Which guide could one recommend ?

@evgenity

This comment has been minimized.

Show comment
Hide comment
@evgenity

evgenity Aug 5, 2016

This helped me:

> locale-gen en_US en_US.UTF-8
> dpkg-reconfigure locales

evgenity commented Aug 5, 2016

This helped me:

> locale-gen en_US en_US.UTF-8
> dpkg-reconfigure locales
@chani

This comment has been minimized.

Show comment
Hide comment
@chani

chani Nov 29, 2016

same issue, apt-get install letsencrypt does not help to resolve that. To resolve that issue I had to:

~ # apt-get install python-pip
~ # pip install setuptools
Traceback (most recent call last):
  File "/usr/bin/pip", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 215, in main
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python2.7/locale.py", line 581, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

then

~ # export LC_ALL="en_US.UTF-8"
-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
~ # export LC_CTYPE="en_US.UTF-8"
~ # pip install setuptools
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.7/dist-packages
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

... then ...

~ # pip install --upgrade setuptools     
Collecting setuptools
  Downloading setuptools-29.0.1-py2.py3-none-any.whl (472kB)
    100% |████████████████████████████████| 481kB 3.0MB/s 
Installing collected packages: setuptools
  Found existing installation: setuptools 20.7.0
    Not uninstalling setuptools at /usr/lib/python2.7/dist-packages, outside environment /usr
Successfully installed setuptools-29.0.1
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

now it works. So I assume "setuptools" in Ubuntu 16.04 LTS are just too old.

chani commented Nov 29, 2016

same issue, apt-get install letsencrypt does not help to resolve that. To resolve that issue I had to:

~ # apt-get install python-pip
~ # pip install setuptools
Traceback (most recent call last):
  File "/usr/bin/pip", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 215, in main
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python2.7/locale.py", line 581, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

then

~ # export LC_ALL="en_US.UTF-8"
-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
~ # export LC_CTYPE="en_US.UTF-8"
~ # pip install setuptools
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.7/dist-packages
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

... then ...

~ # pip install --upgrade setuptools     
Collecting setuptools
  Downloading setuptools-29.0.1-py2.py3-none-any.whl (472kB)
    100% |████████████████████████████████| 481kB 3.0MB/s 
Installing collected packages: setuptools
  Found existing installation: setuptools 20.7.0
    Not uninstalling setuptools at /usr/lib/python2.7/dist-packages, outside environment /usr
Successfully installed setuptools-29.0.1
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

now it works. So I assume "setuptools" in Ubuntu 16.04 LTS are just too old.

@StavrosHacker

This comment has been minimized.

Show comment
Hide comment

@chani thank you :)

@inoyakaigor

This comment has been minimized.

Show comment
Hide comment
@inoyakaigor

inoyakaigor Mar 17, 2017

Also works for ru_RU locale 🇷🇺

This helped me:

locale-gen en_US en_US.UTF-8
dpkg-reconfigure locales

Also works for ru_RU locale 🇷🇺

This helped me:

locale-gen en_US en_US.UTF-8
dpkg-reconfigure locales

@porimol

This comment has been minimized.

Show comment
Hide comment
@porimol

porimol Mar 29, 2017

I followed the solution given by @evgenity and its perfectly work.

porimol commented Mar 29, 2017

I followed the solution given by @evgenity and its perfectly work.

@cyphercolt

This comment has been minimized.

Show comment
Hide comment
@cyphercolt

cyphercolt Apr 27, 2017

This thread was helpful, thank you! I couldn't create a Virtual Environment with virtualenv for Python because of pip/locale issues. To fix it I went through everything everyone posted on here (especially reconfiguring the locale and installing pip setuptools)

Thanks again!

This thread was helpful, thank you! I couldn't create a Virtual Environment with virtualenv for Python because of pip/locale issues. To fix it I went through everything everyone posted on here (especially reconfiguring the locale and installing pip setuptools)

Thanks again!

@yan12125

This comment has been minimized.

Show comment
Hide comment
@yan12125

yan12125 Apr 28, 2017

Collaborator

Seems this is a duplicate of #2887

Collaborator

yan12125 commented Apr 28, 2017

Seems this is a duplicate of #2887

@knowThis

This comment has been minimized.

Show comment
Hide comment
@knowThis

knowThis Sep 4, 2017

I've tried the above solutions without solving the same problem.but i find some solution in "lnmp" about aliyun host problems . https://bbs.vpser.net/thread-16253-1-1.html#pid50671.
apt-get purge python-virtualenv python3-virtualenv virtualenv
pip install --upgrade pip
pip install virtualenv
vim /bin/lnmp
replace /bin/certbot certonly to /bin/certbot --no-bootstrap certonly

knowThis commented Sep 4, 2017

I've tried the above solutions without solving the same problem.but i find some solution in "lnmp" about aliyun host problems . https://bbs.vpser.net/thread-16253-1-1.html#pid50671.
apt-get purge python-virtualenv python3-virtualenv virtualenv
pip install --upgrade pip
pip install virtualenv
vim /bin/lnmp
replace /bin/certbot certonly to /bin/certbot --no-bootstrap certonly

@xratzh

This comment has been minimized.

Show comment
Hide comment
@xratzh

xratzh Sep 6, 2017

locale-gen en_US en_US.UTF-8 & locale-gen

xratzh commented Sep 6, 2017

locale-gen en_US en_US.UTF-8 & locale-gen

@leonardozhe

This comment has been minimized.

Show comment
Hide comment
@leonardozhe

leonardozhe Nov 26, 2017

Ubuntu 16.04 x64 Fixed issue by 2 step:

  1. apt-get install letsencrypt
  2. exoprt below
    export LC_ALL="en_US.UTF-8"
    export LC_CTYPE="en_US.UTF-8"

thanks!

Ubuntu 16.04 x64 Fixed issue by 2 step:

  1. apt-get install letsencrypt
  2. exoprt below
    export LC_ALL="en_US.UTF-8"
    export LC_CTYPE="en_US.UTF-8"

thanks!

@neoedmund

This comment has been minimized.

Show comment
Hide comment
@neoedmund

neoedmund Dec 28, 2017

Add --no-bootstrap to certbot command line helps for me.
It seems a problem with python versions. Python 2.7 works well on the whole process. So you should uninstall all python3 before running certbot. But some system use Python3 as default, and when you running virtualenv , Python3 and Python2 messed up.
I wonder why certbot use virtualenv?
I also suggest cerbot don't try to install packages because you don't know what python version of packages will be installed actually. And bring your own dependence binaries. Because sometime dependence is hell.

Add --no-bootstrap to certbot command line helps for me.
It seems a problem with python versions. Python 2.7 works well on the whole process. So you should uninstall all python3 before running certbot. But some system use Python3 as default, and when you running virtualenv , Python3 and Python2 messed up.
I wonder why certbot use virtualenv?
I also suggest cerbot don't try to install packages because you don't know what python version of packages will be installed actually. And bring your own dependence binaries. Because sometime dependence is hell.

@robguinness

This comment has been minimized.

Show comment
Hide comment
@robguinness

robguinness Jan 24, 2018

Setting the locales also worked for me. Is this considered an actual bug in certbot, a documentation issue, or a user error???

Setting the locales also worked for me. Is this considered an actual bug in certbot, a documentation issue, or a user error???

@AjkP

This comment has been minimized.

Show comment
Hide comment
@AjkP

AjkP Feb 4, 2018

+1 on getting this documented OR fixed.

AjkP commented Feb 4, 2018

+1 on getting this documented OR fixed.

@azzzdiggr

This comment has been minimized.

Show comment
Hide comment
@azzzdiggr

azzzdiggr May 21, 2018

For me, It worked with this... Please read the error then follow any instructions.

$export LC_ALL="en_US.UTF-8"
$export LC_CTYPE="en_US.UTF-8"

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key
$ sudo apt-get update

Replace $key with the corresponding $key from your GPG error.

for SSL certificate Signing with certbot using letsencrypt
$ certbot-auto certonly --standalone -d $DOMAIN --preferred-challenges http
--agree-tos -n -m $EMAIL --keep-until-expiring

For me, It worked with this... Please read the error then follow any instructions.

$export LC_ALL="en_US.UTF-8"
$export LC_CTYPE="en_US.UTF-8"

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key
$ sudo apt-get update

Replace $key with the corresponding $key from your GPG error.

for SSL certificate Signing with certbot using letsencrypt
$ certbot-auto certonly --standalone -d $DOMAIN --preferred-challenges http
--agree-tos -n -m $EMAIL --keep-until-expiring

@Ayms

This comment has been minimized.

Show comment
Hide comment
@Ayms

Ayms Jun 18, 2018

Debian 7 wheezy and starting to be fed up about this pythonesque stuff, I thought it would take 5 mn to use letsencrypt

First I got:

ImportError: No module named zlib

Which was solved using http://doc.biblissima-condorcet.fr/loris-setup-guide-ubuntu-debian 1.1

Now I have:

Traceback (most recent call last):
  File "/tmp/tmp.03OPotGaYT/fetch.py", line 21, in <module>
    import ssl
  File "/usr/local/lib/python2.7/ssl.py", line 60, in <module>
    import _ssl             # if we can't import it, let the error propagate

---> error 1

ImportError: /usr/local/lib/python2.7/lib-dynload/_ssl.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8
WARNING: unable to check for updates.
Creating virtual environment...
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 2343, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 712, in main
    symlink=options.symlink)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 947, in create_environment
    download=download,
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 904, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 796, in call_subprocess
    % (cmd_desc, proc.returncode))

---> fatal error 2

OSError: Command /opt/eff.org/certbot/venv/bin/python2.7 - setuptools pip wheel failed with error code 1

What is this virtual env intended for? I have tried whatever is advised in this thread without success

Ayms commented Jun 18, 2018

Debian 7 wheezy and starting to be fed up about this pythonesque stuff, I thought it would take 5 mn to use letsencrypt

First I got:

ImportError: No module named zlib

Which was solved using http://doc.biblissima-condorcet.fr/loris-setup-guide-ubuntu-debian 1.1

Now I have:

Traceback (most recent call last):
  File "/tmp/tmp.03OPotGaYT/fetch.py", line 21, in <module>
    import ssl
  File "/usr/local/lib/python2.7/ssl.py", line 60, in <module>
    import _ssl             # if we can't import it, let the error propagate

---> error 1

ImportError: /usr/local/lib/python2.7/lib-dynload/_ssl.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8
WARNING: unable to check for updates.
Creating virtual environment...
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 2343, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 712, in main
    symlink=options.symlink)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 947, in create_environment
    download=download,
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 904, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 796, in call_subprocess
    % (cmd_desc, proc.returncode))

---> fatal error 2

OSError: Command /opt/eff.org/certbot/venv/bin/python2.7 - setuptools pip wheel failed with error code 1

What is this virtual env intended for? I have tried whatever is advised in this thread without success

@Ayms

This comment has been minimized.

Show comment
Hide comment
@Ayms

Ayms Jun 18, 2018

It looks to be working now after using the instructions in last comment of https://stackoverflow.com/questions/42189878/pythonsetuptools-pkg-resources-pip-wheel-failed-with-error-code-1-error/42189903

Don't get very well why something that is supposed to ease the life of everybody is so complicate to install, would be much easier with a simple nodejs module

Ayms commented Jun 18, 2018

It looks to be working now after using the instructions in last comment of https://stackoverflow.com/questions/42189878/pythonsetuptools-pkg-resources-pip-wheel-failed-with-error-code-1-error/42189903

Don't get very well why something that is supposed to ease the life of everybody is so complicate to install, would be much easier with a simple nodejs module

kcoffau added a commit to kcoffau/Sparks that referenced this issue Jul 22, 2018

Update sparks_install.sh
added languages correction for sentinel (pip_wheel) failing to install.   based on here: certbot/certbot#2883
@wwboy6

This comment has been minimized.

Show comment
Hide comment
@wwboy6

wwboy6 Aug 3, 2018

This error can be reproduced when index-url of pkg-resoures is set to the server without complete resources. This would happen to the user using cloud service with custom pip.conf. Update pip.conf would be a possible solution to this issue.

mv /root/.pip/pip.conf  /root/.pip/pip.conf.bk
vi /root/.pip/pip.conf 

insert following to pip.conf

[global]
index-url=https://pypi.python.org/simple/
[install]
trusted-host=pypi.python.org

Reference (Chinese website): https://blog.csdn.net/Tsinghua2MIT/article/details/79945625

wwboy6 commented Aug 3, 2018

This error can be reproduced when index-url of pkg-resoures is set to the server without complete resources. This would happen to the user using cloud service with custom pip.conf. Update pip.conf would be a possible solution to this issue.

mv /root/.pip/pip.conf  /root/.pip/pip.conf.bk
vi /root/.pip/pip.conf 

insert following to pip.conf

[global]
index-url=https://pypi.python.org/simple/
[install]
trusted-host=pypi.python.org

Reference (Chinese website): https://blog.csdn.net/Tsinghua2MIT/article/details/79945625

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment