Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1671 votes
21 answers
3.0m views

How do I install pip on macOS or OS X?

I spent most of the day yesterday searching for a clear answer for installing pip (package manager for Python). I can't find a good solution. How do I install it?
The System's user avatar
  • 16.8k
656 votes
39 answers
2.2m views

bash: pip: command not found

I downloaded pip and ran python setup.py install and everything worked just fine. The very next step in the tutorial is to run pip install <lib you want> but before it even tries to find ...
Trindaz's user avatar
  • 17.6k
512 votes
1 answer
198k views

Installation Issue with matplotlib Python [duplicate]

I have issue after installing the matplotlib package unable to import matplotlib.pyplot as plt. Any suggestion will be greatly appreciate. >>> import matplotlib.pyplot as plt Traceback (...
Nivir's user avatar
  • 30.9k
495 votes
21 answers
915k views

How to set Python's default version to 3.x on OS X? [duplicate]

I'm running Mountain Lion and the basic default Python version is 2.7. I downloaded Python 3.3 and want to set it as default. Currently: $ python version 2.7.5 $ python3.3 version 3.3 How ...
Marcus's user avatar
  • 9,302
452 votes
17 answers
1.1m views

How to uninstall Python 2.7 on a Mac OS X 10.6.4?

I want to completely remove Python 2.7 from my Mac OS X 10.6.4. I managed to remove the entry from the PATH variable by reverting my .bash_profile. But I also want to remove all directories, files, ...
Jan Deinhard's user avatar
416 votes
31 answers
1.4m views

Error running 'pip install': "ImportError: No module named pip" [duplicate]

OS: Mac OS X 10.7.5 (Lion) Python ver: 2.7.5 I have installed setuptools 1.0 with ez_setup.py from https://pypi.python.org/pypi/setuptools. Then I downloaded pip.1.4.1 pkg from https://pypi.python....
David Lu's user avatar
  • 4,161
389 votes
21 answers
1.1m views

How to install PIL with pip on Mac OS?

I am trying to install PIL (the Python Imaging Library) using the command: sudo pip install pil but I get the following message: Downloading/unpacking PIL You are installing a potentially insecure ...
user3006710's user avatar
  • 3,927
363 votes
32 answers
628k views

Virtualenv Command Not Found

I couldn't get virtualenv to work despite various attempts. I installed virtualenv on MAC OS X using: pip install virtualenv and have also added the PATH into my .bash_profile. Every time I try to ...
Arial's user avatar
  • 4,984
327 votes
17 answers
684k views

socket.error: [Errno 48] Address already in use

I'm trying to set up a server with python from mac terminal. I navigate to folder location an use: python -m SimpleHTTPServer But this gives me error: socket.error: [Errno 48] Address already ...
irm's user avatar
  • 4,251
315 votes
15 answers
336k views

pip installs packages successfully, but executables not found from command line

I am working on mac OS X Yosemite, version 10.10.3. I installed python2.7 and pip using macport as done in http://johnlaudun.org/20150512-installing-and-setting-pip-with-macports/ I can ...
Sanket_Diwale's user avatar
288 votes
30 answers
628k views

certificate verify failed: unable to get local issuer certificate

I am trying to get data from the web using python. I imported urllib.request package for it but while executing, I get error: certificate verify failed: unable to get local issuer certificate (_ssl.c:...
biswajit's user avatar
  • 3,177
260 votes
22 answers
603k views

Could not install packages due to an EnvironmentError: [Errno 13]

In my MacOS Mojave terminal I wanted to install a python package with pip. At the end it says: You are using pip version 10.0.1, however version 18.1 is available. You should consider upgrading via ...
Adler's user avatar
  • 2,743
251 votes
26 answers
123k views

Broken references in Virtualenvs

I recently installed a bunch of dotfiles on my Mac along with some other applications (I changed to iTerm instead of Terminal, and Sublime as my default text editor) but ever since, all my virtual ...
oxtay's user avatar
  • 4,000
244 votes
25 answers
110k views

Cannot install Lxml on Mac OS X 10.9

I want to install Lxml so I can then install Scrapy. When I updated my Mac today it wouldn't let me reinstall lxml, I get the following error: In file included from src/lxml/lxml.etree.c:314: /private/...
David O'Regan's user avatar
237 votes
15 answers
137k views

"ERROR:root:code for hash md5 was not found" when using any hg mercurial commands

When trying to use any hg Mercurial commands on the console, I keep getting this error. I installed Python using Homebrew and I am running Mac OS Catalina v. 10.15.1. Any reference would be ...
poca's user avatar
  • 3,688
237 votes
18 answers
515k views

How can I fix the "zsh: command not found: python" error? (macOS Monterey 12.3, Python&nbsp;3.10, Atom IDE, and atom-python-run 0.9.7)

Since I got the macOS v12.3 (Monterey) update (not sure it's related though), I have been getting this error when I try to run my Python code in the terminal: I am using Python 3.10.3, Atom IDE, and ...
Kirill Ignatyev's user avatar
237 votes
10 answers
188k views

How do you see the entire command history in interactive Python?

I'm working on the default python interpreter on Mac OS X, and I Cmd+K (cleared) my earlier commands. I can go through them one by one using the arrow keys. But is there an option like the --history ...
Lavanya's user avatar
  • 2,968
231 votes
9 answers
245k views

Why am I getting "Permission denied" when activating a venv?

I just started a new python project and created a venv inside the project folder by running virtualenv venv in the terminal. However, when I run venv/bin/activate I get a permission denied error. I ...
user3088202's user avatar
  • 3,024
224 votes
22 answers
974k views

How to change default Python version?

I have installed Python 3.2 on my Mac. After I run /Applications/Python 3.2/Update Shell Profile.command, it's confusing that when I type python -V in Terminal, it says Python 2.6.1 which is not what ...
Zhu Shengqi's user avatar
  • 3,752
224 votes
14 answers
510k views

How to uninstall Anaconda completely from macOS

How can I completely uninstall Anaconda from MacOS Sierra and revert back to the original Python? I have tried using conda-clean -yes but that doesn't work. I also remove the stuff in ~/.bash_profile ...
Jordan Baron's user avatar
  • 3,992
216 votes
6 answers
747k views

Why is the apt-get function not working in the terminal on Mac OS X v10.9 (Mavericks)?

I was watching this, and, as you can see, the first command I am told to put in is: sudo apt-get install python-setuptools When I do this, it outputs: sudo: apt-get: command not found I have no ...
user2800761's user avatar
  • 2,295
211 votes
10 answers
249k views

pip or pip3 to install packages for Python 3?

I have a Macbook with OS X El Captain. I think that Python 2.7 comes preinstalled on it. However, I installed Python 3.5 too. When I started using Python 3, I read that if I want to install a package, ...
Ammar Alyousfi's user avatar
210 votes
18 answers
231k views

"OSError: [Errno 1] Operation not permitted" when installing Scrapy in OSX 10.11 (El Capitan) (System Integrity Protection)

I'm trying to install Scrapy Python framework in OSX 10.11 (El Capitan) via pip. The installation script downloads the required modules and at some point returns the following error: OSError: [Errno ...
Luis U.'s user avatar
  • 2,500
200 votes
15 answers
238k views

How to reinstall python@2 from Homebrew?

I have been having issues with openssl and python@2 with brew, which have explained here (unresolved). The documented workaround to reinstall Python and openssl was not working, so I decided I would ...
Pauline's user avatar
  • 3,766
190 votes
5 answers
97k views

Multiprocessing causes Python to crash and gives an error may have been in progress in another thread when fork() was called

I am relatively new to Python and trying to implement a Multiprocessing module for my for loop. I have an array of Image url's stored in img_urls which I need to download and apply some Google vision....
SriTeja Chilakamarri's user avatar
189 votes
17 answers
146k views

Open document with default OS application in Python, both in Windows and Mac OS

I need to be able to open a document using its default application in Windows and Mac OS. Basically, I want to do the same thing that happens when you double-click on the document icon in Explorer or ...
Abdullah Jibaly's user avatar
186 votes
25 answers
799k views

Updating Python on Mac

I wanted to update my python 2.6.1 to 3.x on mac but I was wondering if it's possible to do it using the terminal or I have to download the installer from python website? I am asking this question ...
itsaboutcode's user avatar
  • 24.9k
179 votes
3 answers
148k views

How to install two versions of Anaconda (Python 2 and 3) on Mac OS

I'm relatively new in macOS. I've just installed XCode (for c++ compiler) and Anaconda with the latest Python 3 (for myself). Now I'm wondering how to install properly second Anaconda (for work) with ...
night_bat's user avatar
  • 3,222
163 votes
8 answers
204k views

How can I install a previous version of Python 3 in macOS using homebrew?

How can I install a previous version of Python 3 in macOS using brew? With the command brew install python I got the latest version of Python 3 (currently v3.7.0), but I want the last version of ...
ePi272314's user avatar
  • 13.2k
158 votes
25 answers
141k views

Where is virtualenvwrapper.sh after pip install?

I'm trying to setup virtualenvwrapper on OSX, and all the instructions and tutorials I've found tell me to add a source command to .profile, pointing towards virtualenvwrapper.sh. I've checked all the ...
zakdances's user avatar
  • 23.1k
158 votes
12 answers
660k views

python location on mac osx

I'm a little confused with the python on osx. I do not know if the previous owner of the laptop has installed macpython using macport. And I remembered that osx has an builtin version of python. I ...
goh's user avatar
  • 29k
156 votes
3 answers
466k views

Reading tab-delimited file with Pandas - works on Windows, but not on Mac

I've been reading a tab-delimited data file in Windows with Pandas/Python without any problems. The data file contains notes in first three lines and then follows with a header. df = pd.read_csv(...
user3062149's user avatar
  • 4,353
156 votes
38 answers
194k views

pip installing in global site-packages instead of virtualenv

Using pip3 to install a package in a virtualenv causes the package to be installed in the global site-packages folder instead of the one in the virtualenv folder. Here's how I set up Python3 and ...
DocZerø's user avatar
  • 8,437
153 votes
10 answers
184k views

Mac OS X - EnvironmentError: mysql_config not found

First off, yeah, I've already seen this: pip install mysql-python fails with EnvironmentError: mysql_config not found The problem I am trying to use Django on a Google App Engine project. However, ...
daniel_c05's user avatar
  • 11.5k
148 votes
17 answers
340k views

How to install pip for Python 3 on Mac OS X?

OS X (Mavericks) has Python 2.7 stock installed. But I do all my own personal Python stuff with 3.3. I just flushed my 3.3.2 install and installed the new 3.3.3. So I need to install pyserial again. I ...
Travis Griggs's user avatar
146 votes
10 answers
520k views

Where do I find the bashrc file on Mac?

Hello I am following this page.. I'm installing Python onto my mac so that I can set up a Django / Eclipse development environment. However I am not too sure how to go about executing this step: The ...
pencilVester's user avatar
  • 1,471
135 votes
22 answers
351k views

What's a good IDE for Python on Mac OS X? [closed]

I'm about to start a new job where the coding practices are heavily centered around TDD and refactoring, and whose primary development language is Python. I come from the Java world, and have been a ...
Chris R's user avatar
  • 17.8k
134 votes
42 answers
407k views

PySpark: "Exception: Java gateway process exited before sending the driver its port number"

I'm trying to run PySpark on my MacBook Air. When I try starting it up, I get the error: Exception: Java gateway process exited before sending the driver its port number when sc = SparkContext() is ...
mt88's user avatar
  • 2,945
133 votes
8 answers
227k views

pip3: bad interpreter: No such file or directory

I am trying to install dependencies using pip3 command current scenario: Dev$ which python /Users/Dev/anaconda/bin/python Dev$ which python3 /usr/local/bin/python3 Dev$ pip --version pip 10.0.1 ...
floss's user avatar
  • 2,753
131 votes
28 answers
94k views

Can't install PIL after Mac OS X 10.9

I've just updated my Mac OS to 10.9 and I discovered that some (all?) of my Python modules are not here anymore, especially the Image one. So I try to execute sudo pip install pil, but I get this ...
Vincent Audebert's user avatar
130 votes
6 answers
191k views

Getting "Permission Denied" when running pip as root on my Mac

I've started to use my Mac to install Python packages in the same way I do with my Windows PC at work; however on my Mac I've come across frequent permission denied errors while writing to log files ...
markwalker_'s user avatar
  • 12.8k
128 votes
14 answers
116k views

Mac + virtualenv + pip + postgresql = Error: pg_config executable not found

I was trying to install postgres for a tutorial, but pip gives me error: pip install psycopg A snip of error I get: Error: pg_config executable not found. Please add the directory containing ...
KGo's user avatar
  • 19.6k
127 votes
13 answers
170k views

What is the most compatible way to install python modules on a Mac?

I'm starting to learn python and loving it. I work on a Mac mainly as well as Linux. I'm finding that on Linux (Ubuntu 9.04 mostly) when I install a python module using apt-get it works fine. I can ...
GloryFish's user avatar
  • 13.3k
121 votes
18 answers
190k views

Mac OSX python ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)

Many operations in Python require accessing things via https. This includes pip install command, or just using http.client.HTTPSConnection, or any modules or applications that use these things ...
Edward Ned Harvey's user avatar
118 votes
22 answers
232k views

pip installation /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory

I don't know what's the deal but I am stuck following some stackoverflow solutions which gets nowhere. Can you please help me on this? Monas-MacBook-Pro:CS764 mona$ sudo python get-pip.py The ...
Mona Jalal's user avatar
118 votes
6 answers
161k views

Make python3 as my default python on Mac

What I'm trying to do here is to make python3 as my default python. Except the python 2.7 which automatically installed on mac, I installed python3 with homebrew. This is the website that I'm ...
Sambo Kim's user avatar
  • 1,443
113 votes
16 answers
99k views

Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized

Getting the error message when using matplotlib: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized OMP: Hint: This means that multiple copies of the ...
gcamargo's user avatar
  • 3,903
113 votes
10 answers
643k views

How to run Python script on terminal?

I want to run a Python script in Terminal, but I don't know how? I already have a saved file called gameover.py in the directory "/User/luca/Documents/python".
SnakeEyes's user avatar
  • 1,317
111 votes
19 answers
86k views

Can't install psycopg2 package through pip install on MacOS

I am working on a project for one of my lectures and I need to download the package psycopg2 in order to work with the postgresql database in use. Unfortunately, when I try to pip install psycopg2 the ...
Jome's user avatar
  • 1,315
110 votes
11 answers
295k views

SSL: CERTIFICATE_VERIFY_FAILED with Python3 [duplicate]

I apologize if this is a silly question, but I have been trying to teach myself how to use BeautifulSoup so that I can create a few projects. I was following this link as a tutorial: https://www....
PafflesWancakes's user avatar

1
2 3 4 5
217