IgnoredAmbience / yahoo-group-archiver

Scrapes and archives a Yahoo groups email archives, photo galleries and file contents using the non-public API
MIT License
93 stars 45 forks source link

ImportError: No module named requests #86

Closed megalithicportal closed 5 years ago

megalithicportal commented 5 years ago

Apologies if this is something stupid. Running on OpenSuse, yast2 says I have Python 2.7.13 installed. Thanks

asb@linux-o6qj:~/data/asb/yahoogroups> sudo pip install -r requirements.txt
[sudo] password for root: 
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python3.4/site-packages (from -r requirements.txt (line 1))
Collecting warcio (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/90/c4/86bc02bc3bc33c34ab24e52af8a1c34eb6e03e7cd5b3904057ebcea311da/warcio-1.7.1-py2.py3-none-any.whl (41kB)
    100% |████████████████████████████████| 45kB 971kB/s 
Collecting six (from warcio->-r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: six, warcio
Successfully installed six-1.12.0 warcio-1.7.1
You are using pip version 7.1.2, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.                                                                                                            
asb@linux-o6qj:~/data/asb/yahoogroups> ./yahoo.py
Traceback (most recent call last):
  File "./yahoo.py", line 3, in <module>
    from yahoogroupsapi import YahooGroupsAPI
  File "/data/asb/yahoogroups/yahoogroupsapi.py", line 14, in <module>
    import requests  # Must be imported after capture_http
ImportError: No module named requests
asb@linux-o6qj:~/data/asb/yahoogroups> sudo ./yahoo.py
Traceback (most recent call last):
  File "./yahoo.py", line 3, in <module>
    from yahoogroupsapi import YahooGroupsAPI
  File "/data/asb/yahoogroups/yahoogroupsapi.py", line 14, in <module>
    import requests  # Must be imported after capture_http
ImportError: No module named requests
asb@linux-o6qj:~/data/asb/yahoogroups> sudo pip install requests
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python3.4/site-packages
You are using pip version 7.1.2, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.                                                                                                            
asb@linux-o6qj:~/data/asb/yahoogroups> sudo pip install --upgrade pip      
Collecting pip
  Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
    100% |████████████████████████████████| 1.4MB 318kB/s 
Installing collected packages: pip
  Found existing installation: pip 7.1.2
    Uninstalling pip-7.1.2:
      Successfully uninstalled pip-7.1.2
Successfully installed pip-19.3.1
asb@linux-o6qj:~/data/asb/yahoogroups> 
asb@linux-o6qj:~/data/asb/yahoogroups> sudo pip install -r requirements.txt
Requirement already satisfied: requests in /usr/lib/python3.4/site-packages (from -r requirements.txt (line 1)) (2.7.0)
Requirement already satisfied: warcio in /usr/lib/python3.4/site-packages (from -r requirements.txt (line 2)) (1.7.1)
Requirement already satisfied: six in /usr/lib/python3.4/site-packages (from warcio->-r requirements.txt (line 2)) (1.12.0)
asb@linux-o6qj:~/data/asb/yahoogroups> ./yahoo.py                          
Traceback (most recent call last):
  File "./yahoo.py", line 3, in <module>
    from yahoogroupsapi import YahooGroupsAPI
  File "/data/asb/yahoogroups/yahoogroupsapi.py", line 14, in <module>
    import requests  # Must be imported after capture_http
ImportError: No module named requests
asb@linux-o6qj:~/data/asb/yahoogroups> sudo pip install --upgrade requests
Collecting requests
  Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
     |████████████████████████████████| 61kB 1.4MB/s 
Collecting urllib3<1.25,>=1.21.1
  Downloading https://files.pythonhosted.org/packages/01/11/525b02e4acc0c747de8b6ccdab376331597c569c42ea66ab0a1dbd36eca2/urllib3-1.24.3-py2.py3-none-any.whl (118kB)
     |████████████████████████████████| 122kB 2.1MB/s 
Collecting idna<2.9,>=2.5
  Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
     |████████████████████████████████| 61kB 2.3MB/s 
Collecting certifi>=2017.4.17
  Downloading https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl (154kB)
     |████████████████████████████████| 163kB 2.8MB/s 
Collecting chardet<3.1.0,>=3.0.2
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
     |████████████████████████████████| 143kB 3.0MB/s 
Installing collected packages: urllib3, idna, certifi, chardet, requests
  Found existing installation: requests 2.7.0
    Uninstalling requests-2.7.0:
      Successfully uninstalled requests-2.7.0
Successfully installed certifi-2019.9.11 chardet-3.0.4 idna-2.8 requests-2.21.0 urllib3-1.24.3
asb@linux-o6qj:~/data/asb/yahoogroups> ./yahoo.py
Traceback (most recent call last):
  File "./yahoo.py", line 3, in <module>
    from yahoogroupsapi import YahooGroupsAPI
  File "/data/asb/yahoogroups/yahoogroupsapi.py", line 14, in <module>
    import requests  # Must be imported after capture_http
ImportError: No module named requests
IgnoredAmbience commented 5 years ago

Your python installation looks quite broken, since requests is clearly being installed in that log.

I'd suggest attempting to run the script in a virtualenv. Steps are roughly:

virtualenv env
source env/bin/activate
pip install -r requirements.txt
./yahoo.py ...