fyu / lsun

LSUN Dataset Documentation and Demo Code
531 stars 175 forks source link

No module named request #25

Closed mahmoodn closed 4 years ago

mahmoodn commented 4 years ago

Although requests has been installed via pip, I get the error that no module is named as request.

$ pip install --user request
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting request
  Downloading https://files.pythonhosted.org/packages/f1/27/7cbde262d854aedf217061a97020d66a63163c5c04e0ec02ff98c5d8f44e/request-2019.4.13.tar.gz
Collecting get (from request)
  Downloading https://files.pythonhosted.org/packages/3f/ef/bb46f77f7220ac1b7edba0c76d810c89fddb24ddd8c08f337b9b4a618db7/get-2019.4.13.tar.gz
Collecting post (from request)
  Downloading https://files.pythonhosted.org/packages/0f/05/bd79da5849ea6a92485ed7029ef97b1b75e55c26bc0ed3a7ec769af666f3/post-2019.4.13.tar.gz
Requirement already satisfied: setuptools in /home/mahmood/.local/lib/python2.7/site-packages (from request) (41.0.1)
Collecting query_string (from get->request)
  Downloading https://files.pythonhosted.org/packages/12/3c/412a45daf5bea9b1d06d7de41787ec4168001dfa418db7ec8723356b119f/query-string-2019.4.13.tar.gz
Collecting public (from query_string->get->request)
  Downloading https://files.pythonhosted.org/packages/54/4d/b40004cc6c07665e48af22cfe1e631f219bf4282e15fa76a5b6364f6885c/public-2019.4.13.tar.gz
Building wheels for collected packages: request, get, post, query-string, public
  Building wheel for request (setup.py) ... done
  Created wheel for request: filename=request-2019.4.13-cp27-none-any.whl size=1677 sha256=635c9a974941fd509fd7dfe5f47bf12a96489c47c67f748a8672ff858c40ff52
  Stored in directory: /home/mahmood/.cache/pip/wheels/30/84/5f/484cfba678967ef58c16fce6890925d5c7172622f20111fbfd
  Building wheel for get (setup.py) ... done
  Created wheel for get: filename=get-2019.4.13-cp27-none-any.whl size=1691 sha256=6db08500aa1c1620b31332e0ca0c167927bd6dd2b0e4ec25039cfe13fa232e15
  Stored in directory: /home/mahmood/.cache/pip/wheels/c1/e3/c1/d02c8c58538853e4c9b78cadb74f6d5c5c370b48a69a7271aa
  Building wheel for post (setup.py) ... done
  Created wheel for post: filename=post-2019.4.13-cp27-none-any.whl size=1661 sha256=079dee3764bce7c1f6a44eae59940c4a529c0cd3a0ab10342be4697697fb020c
  Stored in directory: /home/mahmood/.cache/pip/wheels/c3/c3/24/b5c132b537ab380c02d69e6bd4dec1f5db56b5fe19030473d7
  Building wheel for query-string (setup.py) ... done
  Created wheel for query-string: filename=query_string-2019.4.13-cp27-none-any.whl size=2048 sha256=d91766531ceb491430edddb1fd8be7629137904c0c3b0814e1a5709618e75c91
  Stored in directory: /home/mahmood/.cache/pip/wheels/d6/a4/78/01b20a9dc224dcc009fab669f7f27b943b8889c5150bd68d8a
  Building wheel for public (setup.py) ... done
  Created wheel for public: filename=public-2019.4.13-cp27-none-any.whl size=2537 sha256=226deaaa53d129077c1778b2902044b4efd00e67fa5d97113338abdd630ba285
  Stored in directory: /home/mahmood/.cache/pip/wheels/23/7c/6e/f5b4e09d6596c8b8802b347e48f149031e2363368048f1347a
Successfully built request get post query-string public
Installing collected packages: public, query-string, get, post, request
Successfully installed get-2019.4.13 post-2019.4.13 public-2019.4.13 query-string-2019.4.13 request-2019.4.13

$ pip install --user requests
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Requirement already satisfied: requests in /home/mahmood/.local/lib/python2.7/site-packages (2.22.0)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /home/mahmood/.local/lib/python2.7/site-packages (from requests) (1.25.3)
Requirement already satisfied: certifi>=2017.4.17 in /home/mahmood/.local/lib/python2.7/site-packages (from requests) (2019.6.16)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /home/mahmood/.local/lib/python2.7/site-packages (from requests) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/lib/python2.7/dist-packages (from requests) (2.6)
WARNING: You are using pip version 19.2.1, however version 19.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ python download.py -c bedroom
Traceback (most recent call last):
  File "download.py", line 8, in <module>
    from urllib.request import Request, urlopen
ImportError: No module named request

Any thought?

hbarovertwo commented 4 years ago

whatever Python your default Python command points to is not connected to what you pip installed on. I recommend trying python -m pip install requests and then running python download.py and see if requests is being seen now. I've had similar problems working with anaconda installs of python

mahmoodn commented 4 years ago

OK it seems that the scripts doesn't work with python 2.7. I tried 3.6 and it was fine.