“ssl module in Python is not available” when installing package with pip3

后端 未结 28 1438
别跟我提以往
别跟我提以往 2020-11-22 08:51

I\'ve install Python 3.4 and Python 3.6 on my local machine successfully, but am unable to install packages with pip3.

When I execute pip3 install

28条回答
  •  抹茶落季
    2020-11-22 09:17

    The python documentation is actually very clear, and following the instructions did the job whereas other answers I found here were not fixing this issue.

    1. first, install python 3.x.x from source using, for example with version 3.6.2 https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz

    2. make sure you have openssl installed by running brew install openssl

    3. unzip it and move to the python directory: tar xvzf Python-3.6.2.tar.xz && cd Python-3.6.2

    4. then if the python version is < 3.7, run

    CPPFLAGS="-I$(brew --prefix openssl)/include" \ LDFLAGS="-L$(brew --prefix openssl)/lib" \ ./configure --with-pydebug 5. finallly, run make -s -j2 (-s is the silent flag, -j2 tells your machine to use 2 jobs)

提交回复
热议问题