Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resolving PyCharm python error - dyld: Library not loaded

I am using PyCharm 2018.3.2 Community Edition, under macOS Sierra V. 10.12.6

Today I found the following error message in Python-Console:

dyld: Library not loaded: /usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/Python
  Referenced from: /Users/tleis/PycharmProjects/BioInformaticsI/venv/bin/python
  Reason: image not found

After some research, I doubt the reason is due to some commands I run related to HomeBrew.

like image 304
mtleis Avatar asked May 30 '19 18:05

mtleis


People also ask

How to fix dyld library not loaded error on Mac?

How to Fix ‘Dyld: Library not Loaded’ Error on MacOS. If the issue is with your Computer or a Laptop you should try using Reimage Plus which can scan the repositories and replace corrupt and missing files. This works in most cases, where the issue is originated due to a system corruption.

Why does the PyCharm IDE crash at launch?

Finally, the PyCharm IDE itself is implemented in Java. When you launch the IDE it has its own executable and it's a rare case that something related to a Python interpreter should make the IDE crash at launch. On the up side you know the culprit is one of your Python interpreters, namely from the error message:

Does PyCharm work with conda?

So, i can't seem to have PyCharm work correctly with Conda. I installed Anaconda following step by step the procedure on their site (download bash script, execute it). It is installed in ~/anaconda3, as default. I then installed PyCharm Community edition using snap. I then launched PyCharm, and created a Conda environment in it.


3 Answers

The same issue occured with me and I tried to change the project interpreter in the PyCharm IDE as shown below.

When there are multiple versions of Python present in your system, the IDE has to interpret the updated reference as it is in usr/local/bin/python {version}

enter image description here

like image 143
Anupam Avatar answered Nov 12 '22 15:11

Anupam


The error message smells like you've probably updated your Python version, which can occasionally break virtualenvs with those symptoms.

The easiest fix is to just delete and recreate the virtualenv.

like image 39
AKX Avatar answered Nov 12 '22 17:11

AKX


Just create a new virtual environment, by creating a new project. This is mostly because you ran a Python upgrade or did a unlink and re link of the python binaries. Also it helps if you can check at once without IDE , in the terminal if the program is working or not. Creating a new Virtual environment worked for me !!

like image 29
Athul Sreehari Avatar answered Nov 12 '22 15:11

Athul Sreehari