Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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
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
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
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
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
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
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
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
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
71 votes
10 answers
69k views

Why does Python installed via Homebrew not include Tkinter [duplicate]

I've installed Python via Homebrew on my Mac. brew install python After that I checked my Python version as 2.7.11, then I tried to perform import Tkinter I got following error message: Traceback (...
Daniel Chen's user avatar
  • 1,973
63 votes
14 answers
81k views

numpy build fail in M1 Big sur 11.1

I am using MacBook m1 which is running Big Sur 11.1 ,and I have installed Xcode-commandline-tools version 12.3 and it has installed python3.8.5 and pip3 .python3 and pip are native apps,that is they ...
zsh's user avatar
  • 731
58 votes
7 answers
174k views

Switch between python 2.7 and python 3.5 on Mac OS X

I generally use Python 2.7 but recently installed Python 3.5 using Miniconda on Mac OS X. Different libraries have been installed for these two versions of python. Now, the entering either of the ...
Viswanath's user avatar
  • 1,033
57 votes
9 answers
101k views

Install virtualenv and virtualenvwrapper on MacOS

How to install and configure virtualenv and virtualenvwrapper for Python on MacOS?
Stan Reduta's user avatar
  • 3,432
54 votes
12 answers
165k views

Selenium gives "selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary" on Mac

Trying to get selenium to work with Python 3 for web scraping purposes: from selenium import webdriver chrome_path = r"/Library/Frameworks/Python.framework/Versions/3.6/bin/chromedriver" driver = ...
Alex Heebs's user avatar
49 votes
11 answers
89k views

How to install pyaudio on mac using Python 3?

I first tried: pip install pyaudio but I was told that -bash: pip: command not found Then I tried: pip3 install pyaudio Then I got: src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not ...
JasonShao's user avatar
  • 593
43 votes
12 answers
113k views

Pip install on Mac OS gets error: command '/usr/bin/clang' failed with exit code 1

I want to install google-cloud-pubsub via pip installation on Mac OS but I get an error: distutils.errors.CompileError: command '/usr/bin/clang' failed with exit code 1. The command I run: pip install ...
Fausto Fusaro's user avatar
39 votes
3 answers
153k views

Completely uninstall Python 3 on Mac

I installed Python 3 on Mac and installed some packages as well. But then I see AWS lamda does not support Python 3 so I decided to downgrade. I removed Python3 folder in Applications and cleared the ...
Deepak Sharma's user avatar
37 votes
2 answers
19k views

Getting error while trying to run this command " pipenv install requests " in mac OS

I am facing the following error: Warning: the environment variable LANG is not set! We recommend setting this in ~/.profile (or equivalent) for proper expected behavior. Creating a virtualenv for this ...
Bharanidhar Reddy's user avatar
37 votes
4 answers
23k views

This application failed to start because it could not find or load the Qt platform plugin "cocoa"

I think I did everything I could in the last 20 hours, but nothing seems to work. My app is running and working -- just as it should -- the only problem I have is that I cannot create a .app bundle ...
Peter Varo's user avatar
35 votes
8 answers
43k views

Issues installing Python 3.8.10 on macOS 12.3 Monterey

Anyone having issues installing python 3.8.10 on macOS Monterey M1 Mac? Any version I try to install using pyenv install gives me this error: python-build: use [email protected] from homebrew python-build: ...
honikun's user avatar
  • 377
33 votes
4 answers
70k views

How to default Python3.8 on my Mac using Homebrew?

I have updated my python 3 to the latest version 3.8: brew search python ==> Formulae app-engine-python gst-python python ✔ [email protected] ✔ boost-python ipython ...
Tack_Tau's user avatar
  • 657
32 votes
6 answers
78k views

Anaconda and upgrading to new M1 Mac

Background I've just got a new M1 mac mini dev machine, and migrated from my old x86 mac using apple's migration assistant. Doing that also copied over all my conda environments to the new machine (...
Richard's user avatar
  • 3,256
29 votes
5 answers
19k views

Using Python 3.1 with TextMate

TextMate seems to use the built-in Python version I assume (sys.path doesn't work). How do you configure it to use 3.1 instead? I've already installed the 3.1 package and I can use IDLE for ...
eozzy's user avatar
  • 67.9k
28 votes
6 answers
37k views

brew install python3 didn't install pip3

I installed python3 using homebrew but it didn't install pip3 or should I say it installed but it doesn't recognize the command ? Here is what I did: brew install python3 This installed python3 but ...
Alexander Luna's user avatar
28 votes
6 answers
46k views

dyld: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation

vincens@VMAC: python3 dyld: Library not loaded:/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/...
Vincens Chan's user avatar
28 votes
2 answers
31k views

Issues Installing Python 3.x via Pyenv

I have just gotten a new Macbook Air with M1 chip and I am trying to install Python 3.8.3 (or any 3.x version) via pyenv. I was able to install pyenv via Homebrew, but when I try to install a new ...
greenmeansgo's user avatar
28 votes
8 answers
40k views

Installation of earlier versions of Python (prior to 3.8) fails on Mac with M1 Chip (ARM based Apple Silicon)

I have Macbook with Apple M1 Chip in which I have to use Python 3.6.5 for my project. It comes with Python 2.7.16 and 3.8.2 preinstalled. I used brew to install Python which by default installed 3.9.1....
Kundan Kumar's user avatar
26 votes
3 answers
22k views

brew install doesn't link python3

I'm having trouble linking python3 and making python3 the default python. MacOS 10.13.6 Here's what I did: $ python --version Python 2.7.15 $ python3 --version Python 3.7.0 $ xcode-select --version ...
Viet's user avatar
  • 6,813
23 votes
10 answers
23k views

python setup.py egg_info mysqlclient

Trying to install mysqlclient using pip3 on Python 3.6.0 $ pip3 install mysqlclient Collecting mysqlclient Using cached mysqlclient-1.3.10.tar.gz Complete output from command python setup.py ...
Denis Ostrovsky's user avatar
22 votes
4 answers
19k views

python3.8 fails with "Fatal Python error: config_get_locale_encoding"

OK, so somehow I have mangled my python3 installation under macOS Mojave and I'm not sure how. I've used macports for years to keep python up to date but when I installed python38 now I cannot run ...
Mike Byrne's user avatar
21 votes
4 answers
17k views

No Module Named AppKit

I am trying to run an audio file in Python: from playsound import playsound def main(): playsound('audio.mp3') main() However, I keep getting the following error: File "/Library/Frameworks/...
user avatar
21 votes
1 answer
20k views

No such file or directory: 'gdal-config'

I am trying to install fiona and geopandas on a mac machine. I have installed GDAL trough brew install gdal --HEAD If I try install fiona, I get the following: sudo pip3 install fiona Collecting fiona ...
emax's user avatar
  • 7,155
21 votes
2 answers
6k views

OS X cmake can't find PythonLibs 3.4

python and python3 are installed in OS X Yosemite via Homebrew, but cmake fails to find PythonLibs 3, only 2: CMakeLists.txt: set(Python_ADDITIONAL_VERSIONS 3.4) FIND_PACKAGE(PythonInterp REQUIRED) ...
iskhakovt's user avatar
  • 458
18 votes
5 answers
21k views

Can't install OpenCV3 on Anaconda3 python3.6 on macOS

I'm trying to install OpenCV 3.2.0 on Anaconda3 python 3.6 on macOS 10.11.6 but I can't find a way. My Anaconda3 has python 3.5.2 installed but if I create a new virtual environment using $ conda ...
Shah-G's user avatar
  • 672
18 votes
3 answers
14k views

import pyodbc failure mac os

I've tried to install pyodbc on mac, but I got this error Traceback (most recent call last): File "Untitled.py", line 1, in <module> import pyodbc ImportError: dlopen(/usr/local/lib/...
volkoshkursk's user avatar
18 votes
3 answers
10k views

pip install mysqlclient failed "Running setup.py bdist_wheel for mysqlclient ... error"

I'm trying to run my Python 3 project on my newly formatted Mac OS High Sierra 10.13.4, by first running pipenv install to get the dependencies, but that fails. Specifically, the part where it fails ...
dsapalo's user avatar
  • 1,846
18 votes
3 answers
24k views

How to set which version of python sublime text uses

I have been teaching myself python and started out using python 2.7.5 and Sublime Text 2. I recently enrolled in a class and they are using python 3.4. I downloaded and installed python 3.4 onto my ...
Wyze's user avatar
  • 183
18 votes
2 answers
18k views

"OSError: [Errno 22] Invalid argument" when read()ing a huge file

I'm trying to write a small script that prints the checksum of a file (using some code from https://gist.github.com/Zireael-N/ed36997fd1a967d78cb2): import sys import os import hashlib file = '/...
Hallvard's user avatar
  • 201
18 votes
0 answers
12k views

What version(s) of Python is shipped with macOS 11 Big Sur? [closed]

For example running macOS Catalina v10.15, I have /usr/bin/python giving Python 2.7.16 and /usr/bin/python3 giving Python 3.7.3. With macOS Big Sur v11.0, has Apple finally dropped Python 2 and made ...
Peter Cock's user avatar
  • 1,615
17 votes
3 answers
25k views

Jupyter Notebook didn't save for over a day. How can I recover lost work?

I've lost a day's work in Jupyter Notebook because it didn't autosave. As I was working, I would click on File > Save and Checkpoint to be safe. I closed the notebook when I finished working and when ...
Data2Dollars's user avatar
17 votes
3 answers
72k views

ImportError: No module named serial

I have a script written in Python 3 with 3.3.5 installed, and I am getting this error from the terminal whenever I try to run it. I am using a Mac, OSX 10.7.5 I have already installed pyserial (...
user3587244's user avatar
17 votes
3 answers
3k views

Fatal error in extension: PyThreadState_Get: no current thread

I've seen several posts that have stated the same error, but looking and trying out the answers in those posts have not helped. I was wondering if someone could look at this and see if something pops ...
kdheepak's user avatar
  • 1,324
16 votes
1 answer
13k views

Python3 installed successfully, but cannot be opened in terminal

Yesterday I've reinstalled my Mac OS X 10.8, before this reinstallation there were python2.7.5 and python3.3.2 installed on my machine and worked fine, but after this system reinstallation I cannot ...
Zhao Zhang's user avatar
16 votes
2 answers
9k views

Pandas to_csv(sys.stdout) doesn't work under my environment

I ran a following simple script: import sys import pandas as pd df = pd.DataFrame([[1,2,3], [4,5,6]]) df.to_csv(sys.stdout) Expected Output (as standard output) ,0,1,2 0,1,2,3 1,4,5,6 However, I ...
kiichi's user avatar
  • 163
16 votes
2 answers
24k views

Python3 does not find modules installed by pip3

I'm having problems with python3. For some reason that I cannot figure out, the modules available in python3 are not the same as the ones installed via pip3. Running pip3 list in a Terminal returns: ...
altabq's user avatar
  • 1,384
15 votes
7 answers
35k views

Why does loading tensorflow on Mac lead to "Process finished with exit code 132 (interrupted by signal 4: SIGILL)"?

I am using a MacBook Pro with M1 processor, macOS version 11.0.1, Python 3.8 in PyCharm, Tensorflow version 2.4.0rc4 (also tried 2.3.0, 2.3.1, 2.4.0rc0). I am trying to run the following code: import ...
user505117's user avatar
15 votes
2 answers
94k views

Uninstalling python3 on MacOs

I have uninstalled python3 using brew on macOS Catalina 10.15.3: brew uninstall python3 brew list | grep python python@2 But it still there: which python3 /usr/bin/python3 python3 -V Python 3.7.3 ...
mrgloom's user avatar
  • 21.1k
14 votes
2 answers
22k views

UserWarning: Implicit dimension choice for log_softmax has been deprecated

I´m using Mac OS el capitán and I am trying to follow the quick start tutorial for OpenNMT pytorch version. In the training step I get the following warning message: OpenNMT-py/onmt/modules/...
secuaz's user avatar
  • 469
14 votes
5 answers
32k views

How to use wxPython for Python 3?

I installed wxPython 3.0.1.1, but I'm unable to import wx using Python 3.4.1. I am getting the following error: Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 00:54:21) [GCC 4.2.1 (Apple Inc. build ...
Nick's user avatar
  • 10.4k
14 votes
3 answers
20k views

How to upgrade to python 3.5 from 2.7 in Mac OSX

How to upgrade from python 2.7 to 3.5 in Mac OSX? I downloaded python 3.5 .dmg file and installed it. what are the changes I should make for PYTHONPATH and PATH? Is it possible to use both without ...
vidyasagarr7's user avatar

1
2 3 4 5
37