Skip to content
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

Closed
painhardcore opened this issue Apr 22, 2016 · 33 comments
Closed

setuptools pkg_resources pip wheel failed with error code 1 #2883

painhardcore opened this issue Apr 22, 2016 · 33 comments

Comments

@painhardcore
Copy link

./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
Copy link

same issue!

@vincentcox
Copy link

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

@vincentcox
Copy link

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

@joost-van-weenen
Copy link

Same issue on ubuntu 16.04 with the client from git

@asibin
Copy link

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
Copy link

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
Copy link

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
Copy link

evgenity commented Aug 5, 2016

This helped me:

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

@chani
Copy link

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
Copy link

@chani thank you :)

@inoyakaigor
Copy link

Also works for ru_RU locale 🇷🇺

This helped me:

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

@porimol
Copy link

porimol commented Mar 29, 2017

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

@cyphercolt
Copy link

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
Copy link
Collaborator

Seems this is a duplicate of #2887

@jingxiuman
Copy link

jingxiuman 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
Copy link

xratzh commented Sep 6, 2017

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

@leonardozhe
Copy link

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
Copy link

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
Copy link

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

@AjkP
Copy link

AjkP commented Feb 4, 2018

+1 on getting this documented OR fixed.

@dahiyashish-portfolio
Copy link

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
Copy link

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
Copy link

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

@wwboy6
Copy link

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

@bmw
Copy link
Member

bmw commented Aug 15, 2018

I closed #2887 as a duplicate of this, but wanted to keep a link to yan12125's helpful comment.

@dccmmtop
Copy link

dccmmtop commented Dec 2, 2018

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!

I resolved problem by this method

@boyaziqi
Copy link

I resolved the issue by following @wwboy6 answer.

@bote100
Copy link

bote100 commented Aug 11, 2019

This commands solved my problem:

sudo pip install --upgrade setuptools
sudo pip install --upgrade virtualenv
sudo pip install --upgrade pip

@1181406961
Copy link

This commands solved my problem:

sudo pip install --upgrade setuptools
sudo pip install --upgrade virtualenv
sudo pip install --upgrade pip

thanks。This method solved my problem. The virtualenv's version is too old.

@bmw
Copy link
Member

bmw commented Nov 20, 2019

I would strongly advise against running sudo pip. A few of the reasons why are described at https://pages.charlesreid1.com/dont-sudo-pip/. Do not run the sudo pip install command at the top of that page on any system you care about.

@zvolsky
Copy link

zvolsky commented Dec 13, 2019

I've tried allmost all hints from this page without success, include:
@knowthis: I've tried the above solutions without solving the same problem but...
apt-get purge python-virtualenv python3-virtualenv virtualenv
pip install virtualenv

and this doesn't help me. But then I did:
apt install python-virtualenv python3-virtualenv virtualenv
and it works.
(/etc/debian_version: 9.9 - but maybe the system is not properly updated yet, it was 8.x earlier and I just confirmed usage of new repos during apt update)

@stale
Copy link

stale bot commented Dec 12, 2020

We've made a lot of changes to Certbot since this issue was opened. If you still have this issue with an up-to-date version of Certbot, can you please add a comment letting us know? This helps us to better see what issues are still affecting our users. If there is no activity in the next 30 days, this issue will be automatically closed.

@stale stale bot added the needs-update label Dec 12, 2020
@stale
Copy link

stale bot commented Jan 20, 2021

This issue has been closed due to lack of activity, but if you think it should be reopened, please open a new issue with a link to this one and we'll take a look.

@stale stale bot closed this as completed Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests