Catalina Python3 virtual environment creation issues

Answered

I recently upgraded my MacOS to Catalina and switched to the version of python3 bundled there (/usr/bin/python3) and removed the homebrew installation of Python3.  Everything works great from the command line and from PyCharm but only from a virtual environment I've created myself (python3 -m venv). 

When PyCharm creates a new virtual env (Preferences->Project->Project Interpreter) using /usr/bin/python3 as a base interpreter, PyCharm displays the following error

An environment is created, but it is unusable:

userid@localhost dash % source venv3/bin/activate

(venv3) userid@localhost dash % python3

dyld: Library not loaded: @executable_path/../Python3

  Referenced from: /Users/userid/PycharmProjects/dash/venv3/bin/python3

  Reason: image not found

zsh: abort      python3

 

What is Pycharm using to create these virtual environments? Is there somewhere in Pycharm I can configure that?  Do I have some remnants of the brew installed Python3 getting in its way possibly?

6 comments
Comment actions Permalink

I am facing the same issue too!

0
Comment actions Permalink

Hi all,

I'm sorry for the inconvenience.

We were not able to reproduce exactly this problem, but there seem to be some general issues when using this particular interpreter as a base.
Here is a bug report in our tracker https://youtrack.jetbrains.com/issue/PY-38519, please upvote and follow for updates.

0
Comment actions Permalink

If I understand you right, there's a general problem using PyCharm with the version of Python shipping with the MacOS? That sems significant.

The problem seems to be limited to the creation of virtual environments.  Is there a way for end users to configure the way virtual environments are created by PyCharm, or is that buried in PyCharm somewhere?

0
Comment actions Permalink

That's right.

Since yesterday we managed to reproduce your problem https://youtrack.jetbrains.com/issue/PY-38479

>Is there a way for end users to configure the way virtual environments are created by PyCharm, or is that buried in PyCharm somewhere?

Unfortunately, it's not configurable.

0
Comment actions Permalink

I am facing the same issue too!

0
Comment actions Permalink

Fixed in PyCharm CE version 2019.3.1!

0

Please sign in to leave a comment.