Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/usr/bin/python: No module named pip under mac / install python package in mac

Tags:

python

macos

I'm trying to use python with visual code under mac computer

I have this error message :

/usr/bin/python -m pip install pylint
user:~ user$ /usr/bin/python -m pip install pylint
/usr/bin/python: No module named pip

I have find some help and try this :

user:~ user$ easy_install pip
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-19813.pth'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /Library/Python/2.7/site-packages/

I don't uderstand why I have this :

[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-19813.pth'

as I have put this line in my bash_profile

# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH

How can I install library and use python with my mac ? (Usually I use Linux system in my work place but now I am on my personal computer...)

like image 230
SDN Avatar asked Oct 23 '17 11:10

SDN


People also ask

How to fix 'no module named Pip' in Ubuntu?

If you get "No module named pip" in ubuntu, try this. $python3 -m pip --version /usr/bin/python3: No module named pip $sudo apt-get install python3-pip It worked for me. I downloaded pip binaries from here and it resolved the issue. I think none of these answers above can fix your problem. I was also confused by this problem once.

Why does Python Pip have no installation candidate?

Most of the time python pip has no installation candidate Comes when you are updating the version of python. Suppose my Linux system has a python 2. xx version and I want to update the python3 version. To do so I will use the below lines of command. The above command will install the python to the 3.8.20 version.

Did you install Python-Pip in Ubuntu?

Did you install python-pip and/or python3-pip (depending on what you're looking to use)? In Ubuntu, the pip module is not default-installed or default-available - it needs to be installed by running one of the following commands:

What is the use of Pip in Linux?

Pip is a Python packaging module that helps us to install Python libraries. To install Python libraries/modules, you need to install pip - sudo apt-get install python-setuptools sudo easy_install pip sudo apt-get update which pip # To check pip install or not pip install requests


2 Answers

You need to run your easy_install command with sudo privileges if you want to write to /Library

Try running the following command:

sudo easy_install pip

and then enter your password

like image 93
AK47 Avatar answered Nov 15 '22 07:11

AK47


Download get-pip.py from below link get-pip.py

And download pip as

python get-pip.py

After that you can install modules using pip install modulename

like image 39
Sandeep Lade Avatar answered Nov 15 '22 06:11

Sandeep Lade