pip报错 || ERROR: Could not find a version that satisfies the requirement pandas (from versions: none)

1. Problem description

        run import pandas as pd

        The result is an error ModuleNotFoundError: No module named 'pandas'

         I suddenly remembered that I had changed to a new virtual environment and named it eve-gpu (yes, I am a diehard fan of eve ( •̀ ω •́ )✧) but the virtual environment installed the gpu version of tensorflow what

        Since there is no pandas package in the error report, as usual, just use pip install pandas , and then the problem comes again

        ERROR: Could not find a version that satisfies the requirement pandas (from versions: none)
        ERROR: No matching distribution found for pandas


2. Solve the problem

        It's time to summon a powerful search engine (o゚v゚)ノ

        Some posts on the Internet said that it was a network configuration problem, so I checked whether I had installed the Tsinghua mirror~~

         Huh? Obviously there is a Tsinghua mirror, but I still get an error when I run pip install pandas again. It seems that I still haven't found the correct cause of the error.

        Someone on the Internet suggested that there may be multiple pythons installed on the machine. It is difficult for pip to determine which one to use, and pip needs to be specified.

        Try it with the command py -3 -m pip install pandas ( •̀ ω •́ )✧

py -3 -m pip install pandas #指定 python3 的 pip
py -2 -m pip install pandas #指定 python2 的 pip

         Very good, another problem solved (~ ̄▽ ̄)~

         Okay, another water sticker completed (manual dog head) (~ ̄▽ ̄)~


3. Follow-up

        Brother Meng, I Hu Hansan came back again, because I rolled over again (Tsk, your solution is not familiar (¬︿̫̿¬☆)

        When I use the code import pandas as pd in spyder, I get an error again, ModuleNotFoundError: No module named 'pandas' (back to the original starting point, standing in front of the mirror ~~

        why? Obviously, py -3 -m pip install pandas was used before and the installation was successful. Why do you say there is no library? (It is clear that there is no such thing ≡(▔﹏▔)≡

        Once again, I summon the powerful search engine. Many posts say that it may be a problem with the path, and it is necessary to configure environment variables and so on. I understand the reason, but there is no step-by-step instruction map. How should I do it? (For a rookie like me, there is no fool-like tutorial, and when the master leads me in, I will also be stuck at the threshold hhhh, which is why I must po pictures when writing tutorials)

        Having said that, the previous installation failed with pip install pandas, but the installation was successful with py -3 -m pip install pandas. After I searched for answers in all directions, I finally got to a point that I ignored:

        pip3 and py -3 -m pip do the same thing in most cases, with one exception: if they are not on the same path.

        That's right! The exception in my case is not on the same path o( ̄┰ ̄*)ゞ

        Let's go back to the scene to find out

At the same time, I used the command pip list to view the installed packages         in the Anaconda prompt , but pandas was not found, and there was a line of warning that successfully attracted my attention§(* ̄▽ ̄*)§

Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:852)'),)) - skipping

        I searched the Internet, and the solutions on the Internet were again 7788. After trying several solutions and failing, I finally found a successful solution (The emperor pays off, the dog shows a gratifying smile hhhh

        The content of the pip.ini file is:

[global]

index-url=http://mirrors.aliyun.com/pypi/simple/

[install]

trusted-host=mirrors.aliyun.com

         Then set the environment variable. For Windows operating system, add it in  Control Panel=”System and Security=”System=”Advanced System Settings=”Environment Variables=”System Variables=”PATH  , for example, my path is C:\Users\ Administrator\pip\pip.ini, you need to adjust it according to the personal installation path, remember to click OK~~

 

         Then use pip install pandas again, there is no problem~~~

 

Guess you like

Origin blog.csdn.net/Inochigohan/article/details/121884970