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: Invalid installation of Python `requests` package #252

Closed
mpd-dude opened this Issue Jul 17, 2015 · 19 comments

Comments

Projects
None yet
5 participants
@mpd-dude

mpd-dude commented Jul 17, 2015

Solution

#252 (comment)
Run these commands

pip uninstall requests
pip install requests

For Ubuntu 14.04LTS see #252 (comment)

sudo apt-get remove python-requests
[sudo] pip install requests

Hi,
having installed platformio by calling

python get-platformio.py

under x86_64 Cygwin 2.0.4 (host Win 7), python 2.7.10

 ==> Installation process has been successfully FINISHED! <==

 Please RESTART your Terminal Application and run `platformio --help` command.
Traceback (most recent call last):
  File "get-platformio.py", line 145, in 
    sys.exit(main())
  File "get-platformio.py", line 138, in main
    "platformio"]))
  File "get-platformio.py", line 69, in exec_python_cmd
    return exec_command([CURINTERPRETER_PATH] + args, shell=IS_WINDOWS).strip()
  File "get-platformio.py", line 64, in exec_command
    raise Exception(err)
Exception: Error: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/platformio/__main__.py", line 73, in ma                                                                   in
    requests.packages.urllib3.disable_warnings()
AttributeError: 'module' object has no attribute 'packages'

Please let me know if you need more information.

@ivankravets ivankravets added the bug label Jul 18, 2015

@ivankravets ivankravets added this to the 2.2.2 milestone Jul 18, 2015

@ivankravets ivankravets self-assigned this Jul 18, 2015

@ivankravets

This comment has been minimized.

Show comment
Hide comment
@ivankravets
Member

ivankravets commented Jul 21, 2015

@ivankravets

This comment has been minimized.

Show comment
Hide comment
@ivankravets

ivankravets Jul 29, 2015

Member

Please reopen this issue if you still have this problem.

Member

ivankravets commented Jul 29, 2015

Please reopen this issue if you still have this problem.

@mpd-dude

This comment has been minimized.

Show comment
Hide comment
@mpd-dude

mpd-dude Jul 30, 2015

Thank you. Sorry for the delayed answer. I have tried on the same x86_64 Cygwin 2.0.4 (host Win 7), python 2.7.10 installation with the script you provided:

==> Installing Python Package Manager ...
Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages
[SUCCESS]
==> Installing PlatformIO and dependencies ...
Requirement already up-to-date: setuptools in /usr/lib/python2.7/site-packages
Collecting platformio
Requirement already up-to-date: requests>=2.4.0 in /usr/lib/python2.7/site-packages (from platformio)
Requirement already up-to-date: bottle in /usr/lib/python2.7/site-packages (from platformio)
Requirement already up-to-date: pyserial in /usr/lib/python2.7/site-packages (from platformio)
Requirement already up-to-date: click>=3.0 in /usr/lib/python2.7/site-packages (from platformio)
Installing collected packages: platformio
Successfully installed platformio-2.2.1
Collecting http://dl.platformio.org/scons.zip
  Downloading http://dl.platformio.org/scons.zip (863kB)
Installing collected packages: scons
  Running setup.py install for scons
Successfully installed scons
[SUCCESS]
 ==> Installation process has been successfully FINISHED! <==
----------------------------------------
Please RESTART your Terminal Application
----------------------------------------
Then run `platformio --help` command.

So the installation process looks good. But when I restart Cygwin and type (as being told)

platformio --help

the following error occurs:

Error: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/platformio/__main__.py", line 73, in main
    requests.packages.urllib3.disable_warnings()
AttributeError: 'module' object has no attribute 'packages'

Please let me know if you need more information or if I can test more.

mpd-dude commented Jul 30, 2015

Thank you. Sorry for the delayed answer. I have tried on the same x86_64 Cygwin 2.0.4 (host Win 7), python 2.7.10 installation with the script you provided:

==> Installing Python Package Manager ...
Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages
[SUCCESS]
==> Installing PlatformIO and dependencies ...
Requirement already up-to-date: setuptools in /usr/lib/python2.7/site-packages
Collecting platformio
Requirement already up-to-date: requests>=2.4.0 in /usr/lib/python2.7/site-packages (from platformio)
Requirement already up-to-date: bottle in /usr/lib/python2.7/site-packages (from platformio)
Requirement already up-to-date: pyserial in /usr/lib/python2.7/site-packages (from platformio)
Requirement already up-to-date: click>=3.0 in /usr/lib/python2.7/site-packages (from platformio)
Installing collected packages: platformio
Successfully installed platformio-2.2.1
Collecting http://dl.platformio.org/scons.zip
  Downloading http://dl.platformio.org/scons.zip (863kB)
Installing collected packages: scons
  Running setup.py install for scons
Successfully installed scons
[SUCCESS]
 ==> Installation process has been successfully FINISHED! <==
----------------------------------------
Please RESTART your Terminal Application
----------------------------------------
Then run `platformio --help` command.

So the installation process looks good. But when I restart Cygwin and type (as being told)

platformio --help

the following error occurs:

Error: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/platformio/__main__.py", line 73, in main
    requests.packages.urllib3.disable_warnings()
AttributeError: 'module' object has no attribute 'packages'

Please let me know if you need more information or if I can test more.

@mpd-dude

This comment has been minimized.

Show comment
Hide comment
@mpd-dude

mpd-dude Jul 30, 2015

Sorry, but I can not re-open this issue since I didn't close it myself.

mpd-dude commented Jul 30, 2015

Sorry, but I can not re-open this issue since I didn't close it myself.

@ivankravets ivankravets reopened this Jul 30, 2015

@ivankravets ivankravets modified the milestones: 2.3.0, 2.2.2, 2.2.3 Jul 30, 2015

ivankravets added a commit that referenced this issue Jul 31, 2015

@ivankravets

This comment has been minimized.

Show comment
Hide comment
@ivankravets

ivankravets Jul 31, 2015

Member

Could I ask you to try this build?

pip install https://github.com/platformio/platformio/archive/feature/issue-252-cygwin.zip
Member

ivankravets commented Jul 31, 2015

Could I ask you to try this build?

pip install https://github.com/platformio/platformio/archive/feature/issue-252-cygwin.zip
@mpd-dude

This comment has been minimized.

Show comment
Hide comment
@mpd-dude

mpd-dude Aug 2, 2015

Uninstalled the old version. Then installed the build you provided. Result:

$ pip install https://github.com/platformio/platformio/archive/feature/issue-252-cygwin.zip
Collecting https://github.com/platformio/platformio/archive/feature/issue-252-cygwin.zip
  Downloading https://github.com/platformio/platformio/archive/feature/issue-252-cygwin.zip
     / 2.5MB 4.1MB/s
Requirement already satisfied (use --upgrade to upgrade): bottle in /usr/lib/python2.7/site-packages (from platformio==2.2.3.dev0)
Requirement already satisfied (use --upgrade to upgrade): click>=3.0 in /usr/lib/python2.7/site-packages (from platformio==2.2.3.dev0)
Requirement already satisfied (use --upgrade to upgrade): pyserial in /usr/lib/python2.7/site-packages (from platformio==2.2.3.dev0)
Requirement already satisfied (use --upgrade to upgrade): requests>=2.4.0 in /usr/lib/python2.7/site-packages (from platformio==2.2.3.dev0)
Building wheels for collected packages: platformio
  Running setup.py bdist_wheel for platformio
  Stored in directory: /home/aaaaa/.cache/pip/wheels/be/ae/4a/2e4f4672f1b57855e8887a436d44397461868e2edc8259a41c
Successfully built platformio
Installing collected packages: platformio
Successfully installed platformio-2.2.3.dev0

Then typed in

platformio --help

which results in

$ platformio
Traceback (most recent call last):
  File "/usr/bin/platformio", line 7, in 
    from platformio.__main__ import main
  File "/usr/lib/python2.7/site-packages/platformio/__main__.py", line 10, in 
    from requests.packages import urllib3
ImportError: No module named packages

Please let me know if you need more information or if I can test more. Thank you.

mpd-dude commented Aug 2, 2015

Uninstalled the old version. Then installed the build you provided. Result:

$ pip install https://github.com/platformio/platformio/archive/feature/issue-252-cygwin.zip
Collecting https://github.com/platformio/platformio/archive/feature/issue-252-cygwin.zip
  Downloading https://github.com/platformio/platformio/archive/feature/issue-252-cygwin.zip
     / 2.5MB 4.1MB/s
Requirement already satisfied (use --upgrade to upgrade): bottle in /usr/lib/python2.7/site-packages (from platformio==2.2.3.dev0)
Requirement already satisfied (use --upgrade to upgrade): click>=3.0 in /usr/lib/python2.7/site-packages (from platformio==2.2.3.dev0)
Requirement already satisfied (use --upgrade to upgrade): pyserial in /usr/lib/python2.7/site-packages (from platformio==2.2.3.dev0)
Requirement already satisfied (use --upgrade to upgrade): requests>=2.4.0 in /usr/lib/python2.7/site-packages (from platformio==2.2.3.dev0)
Building wheels for collected packages: platformio
  Running setup.py bdist_wheel for platformio
  Stored in directory: /home/aaaaa/.cache/pip/wheels/be/ae/4a/2e4f4672f1b57855e8887a436d44397461868e2edc8259a41c
Successfully built platformio
Installing collected packages: platformio
Successfully installed platformio-2.2.3.dev0

Then typed in

platformio --help

which results in

$ platformio
Traceback (most recent call last):
  File "/usr/bin/platformio", line 7, in 
    from platformio.__main__ import main
  File "/usr/lib/python2.7/site-packages/platformio/__main__.py", line 10, in 
    from requests.packages import urllib3
ImportError: No module named packages

Please let me know if you need more information or if I can test more. Thank you.

@ivankravets

This comment has been minimized.

Show comment
Hide comment
@ivankravets

ivankravets Aug 2, 2015

Member

Hm... Do you see this folder /usr/lib/python2.7/site-packages/requests/packages? Does it contain urllib3 folder?

Member

ivankravets commented Aug 2, 2015

Hm... Do you see this folder /usr/lib/python2.7/site-packages/requests/packages? Does it contain urllib3 folder?

@mpd-dude

This comment has been minimized.

Show comment
Hide comment
@mpd-dude

mpd-dude Aug 2, 2015

Unfortunately there is no "packages" dir. The content of

/usr/lib/python2.7/site-packages/requests/
is:

__init__.py   auth.py     cookies.py      models.py         structures.py
__init__.pyc  auth.pyc    cookies.pyc     models.pyc        structures.pyc
__init__.pyo  auth.pyo    cookies.pyo     models.pyo        structures.pyo
adapters.py   certs.py    exceptions.py   sessions.py       utils.py
adapters.pyc  certs.pyc   exceptions.pyc  sessions.pyc      utils.pyc
adapters.pyo  certs.pyo   exceptions.pyo  sessions.pyo      utils.pyo
api.py        compat.py   hooks.py        status_codes.py
api.pyc       compat.pyc  hooks.pyc       status_codes.pyc
api.pyo       compat.pyo  hooks.pyo       status_codes.pyo

mpd-dude commented Aug 2, 2015

Unfortunately there is no "packages" dir. The content of

/usr/lib/python2.7/site-packages/requests/
is:

__init__.py   auth.py     cookies.py      models.py         structures.py
__init__.pyc  auth.pyc    cookies.pyc     models.pyc        structures.pyc
__init__.pyo  auth.pyo    cookies.pyo     models.pyo        structures.pyo
adapters.py   certs.py    exceptions.py   sessions.py       utils.py
adapters.pyc  certs.pyc   exceptions.pyc  sessions.pyc      utils.pyc
adapters.pyo  certs.pyo   exceptions.pyo  sessions.pyo      utils.pyo
api.py        compat.py   hooks.py        status_codes.py
api.pyc       compat.pyc  hooks.pyc       status_codes.pyc
api.pyo       compat.pyo  hooks.pyo       status_codes.pyo
@ivankravets

This comment has been minimized.

Show comment
Hide comment
@ivankravets

ivankravets Aug 2, 2015

Member

😮 😮 😮

Give me please an output of:

pip list
Member

ivankravets commented Aug 2, 2015

😮 😮 😮

Give me please an output of:

pip list
@mpd-dude

This comment has been minimized.

Show comment
Hide comment
@mpd-dude

mpd-dude Aug 2, 2015

bottle (0.12.8)
bsddb3 (6.1.0)
bzr (2.6b2)
bzr-fastimport (0.13.0.final.0)
cffi (0.9.2)
chardet (2.2.1)
click (4.1)
Codeville (0.8.0)
cvs2svn (2.4.0)
dblatex (0.3.4)
fastimport (0.9.2)
git-review (1.24)
logilab-common (0.62.0)
Mako (1.0.1)
MarkupSafe (0.23)
mercurial (3.3)
numpy (1.9.2)
Pillow (2.8.1)
pip (7.1.0)
platformio (2.2.3.dev0)
ply (3.6)
pycparser (2.12)
Pygments (1.6)
pygobject (3.14.0)
Pyrex (0.9.9)
pyserial (2.7)
reportlab (2.7)
requests (2.7.0)
setuptools (18.0.1)
simplejson (3.6.5)
six (1.9.0)
stgit (0.17.1-dirty)
tailor (0.9.35)
urllib3 (1.10.4)
wheel (0.24.0)

I did a quick search for "urllib3" and this is the result:

/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3
/lib/python2.7/site-packages/urllib3
/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3
/usr/lib/python2.7/site-packages/urllib3

mpd-dude commented Aug 2, 2015

bottle (0.12.8)
bsddb3 (6.1.0)
bzr (2.6b2)
bzr-fastimport (0.13.0.final.0)
cffi (0.9.2)
chardet (2.2.1)
click (4.1)
Codeville (0.8.0)
cvs2svn (2.4.0)
dblatex (0.3.4)
fastimport (0.9.2)
git-review (1.24)
logilab-common (0.62.0)
Mako (1.0.1)
MarkupSafe (0.23)
mercurial (3.3)
numpy (1.9.2)
Pillow (2.8.1)
pip (7.1.0)
platformio (2.2.3.dev0)
ply (3.6)
pycparser (2.12)
Pygments (1.6)
pygobject (3.14.0)
Pyrex (0.9.9)
pyserial (2.7)
reportlab (2.7)
requests (2.7.0)
setuptools (18.0.1)
simplejson (3.6.5)
six (1.9.0)
stgit (0.17.1-dirty)
tailor (0.9.35)
urllib3 (1.10.4)
wheel (0.24.0)

I did a quick search for "urllib3" and this is the result:

/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3
/lib/python2.7/site-packages/urllib3
/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3
/usr/lib/python2.7/site-packages/urllib3
@ivankravets

This comment has been minimized.

Show comment
Hide comment
@ivankravets

ivankravets Aug 2, 2015

Member

Solution

Run these commands

pip uninstall requests
pip install requests
Member

ivankravets commented Aug 2, 2015

Solution

Run these commands

pip uninstall requests
pip install requests
@mpd-dude

This comment has been minimized.

Show comment
Hide comment
@mpd-dude

mpd-dude Aug 3, 2015

Thank you. This helped and now

platformio --help
runs flawlessly :-)

I don't know why the fresh Cygwin installation had this issue with requests. Do you have any idea?

mpd-dude commented Aug 3, 2015

Thank you. This helped and now

platformio --help
runs flawlessly :-)

I don't know why the fresh Cygwin installation had this issue with requests. Do you have any idea?

@ivankravets ivankravets modified the milestones: 2.3.0, 2.2.3 Aug 3, 2015

@ivankravets

This comment has been minimized.

Show comment
Hide comment
@ivankravets

ivankravets Aug 21, 2015

Member

I don't know why the fresh Cygwin installation had this issue with requests. Do you have any idea?

Sorry, don't have any ideas. I've just added to docs/FAQ/code explanation for end user. Thanks!

Member

ivankravets commented Aug 21, 2015

I don't know why the fresh Cygwin installation had this issue with requests. Do you have any idea?

Sorry, don't have any ideas. I've just added to docs/FAQ/code explanation for end user. Thanks!

ivankravets added a commit that referenced this issue Sep 5, 2015

@DefProc

This comment has been minimized.

Show comment
Hide comment
@DefProc

DefProc Oct 9, 2015

I had a related error that references this issue:

Error: Invalid installation of Python `requests` package`. See < https://github.com/platformio/platformio/issues/252 >

thich turned out to be Ubuntu 14.04LTS's install of python-requests that was causing a problem.

Solution:

sudo apt-get remove python-requests

DefProc commented Oct 9, 2015

I had a related error that references this issue:

Error: Invalid installation of Python `requests` package`. See < https://github.com/platformio/platformio/issues/252 >

thich turned out to be Ubuntu 14.04LTS's install of python-requests that was causing a problem.

Solution:

sudo apt-get remove python-requests

@ivankravets ivankravets changed the title from Cygwin - error message after successful installation to Error: Invalid installation of Python `requests` package` Oct 9, 2015

@ivankravets ivankravets changed the title from Error: Invalid installation of Python `requests` package` to Error: Invalid installation of Python `requests` package Oct 9, 2015

@ivankravets

This comment has been minimized.

Show comment
Hide comment
@ivankravets

ivankravets Oct 9, 2015

Member

Thanks @DefProc. I've just added your tip to solutions list above.

Member

ivankravets commented Oct 9, 2015

Thanks @DefProc. I've just added your tip to solutions list above.

@Hkr-Doppelganger

This comment has been minimized.

Show comment
Hide comment
@Hkr-Doppelganger

Hkr-Doppelganger Mar 14, 2017

please help
[!] Looks like you dont have python-requests installed. Please install (apt-get install python-requests) and try again.

help with this

Hkr-Doppelganger commented Mar 14, 2017

please help
[!] Looks like you dont have python-requests installed. Please install (apt-get install python-requests) and try again.

help with this

@Hkr-Doppelganger

This comment has been minimized.

Show comment
Hide comment
@Hkr-Doppelganger

Hkr-Doppelganger Mar 14, 2017

root@localhost:~# setoolkit
bash: setoolkit: command not found

Hkr-Doppelganger commented Mar 14, 2017

root@localhost:~# setoolkit
bash: setoolkit: command not found

@MFornander

This comment has been minimized.

Show comment
Hide comment
@MFornander

MFornander May 27, 2017

I'm running into this.

Ubuntu 16LTS
Both Atom or Atom-Beta
Platform-IO installed either with python script or in Atom
Launching the GUI get be stuck in updating core, restart, repeat
Launching in terminal gets me this requirements link
Trying every combo of uninstall/install requirements does nothing
Have been trying for hours (literally)

MFornander commented May 27, 2017

I'm running into this.

Ubuntu 16LTS
Both Atom or Atom-Beta
Platform-IO installed either with python script or in Atom
Launching the GUI get be stuck in updating core, restart, repeat
Launching in terminal gets me this requirements link
Trying every combo of uninstall/install requirements does nothing
Have been trying for hours (literally)

@ivankravets

This comment has been minimized.

Show comment
Hide comment
Member

ivankravets commented May 27, 2017

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