简体   繁体   中英

module not found when launching python from command line?

I seem to be having a weird issue where I get an error that the "requests" module is not found when I try to launch python from the Windows command line. I've attached the exact entry from the command line below. Is this something with the PYTHONPATH?

C:\Users>python
Fatal Python error: init_import_site: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
  File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python39\Lib\site-packages\shareplum\site.py", line 6, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

I've tried looking at the PATH environmental variable.

try to delete C:\Users\<your Username>\AppData\Local\Programs\Python\Python39\Lib\site-packages\shareplum .

It seems as if this library is overwriting the important internal site package, which is required to run python properly.

Aditionally, it seems to be incorrectly installed, as the requests module is required to run it, but is not installed.

Simply run this in CMD and then try to start python again (it will delete the directory and all of its subdirectorys)(you dont need to replace "%USERNAME%", CMD does that for you.):

rmdir /S /Q "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python39\Lib\site-packages\shareplum"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM