今天使用pip安装pyspark库的时候一直报错
Collecting pyspark
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/pyspark/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618) - skipping
Could not find a version that satisfies the requirement pyspark (from versions: )
No matching distribution found for pyspark
You are using pip version 8.1.2, however version 24.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command
使用pip3更新pip之后还是报错上图,网上找了很多方法,最后发现后面需要再加一个--trusted-host
pip install pyspark -i http://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn
但是还是报错
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-09fbRJ/pyspark/
最后发现是python版本问题,我用的是python3,pip默认是python2,所以要改成
pip3 install pyspark -i http://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn
最后终于成功!
标签:cn,pyspark,pypi,报错,tsinghua,edu,pip,第三方 From: https://blog.csdn.net/m0_68131322/article/details/136900998