Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why my zsh in PyCharm doesn't have correct $PATH?

I'm learning python recently. And I use PyCharm as my editor running in a MacBook. The problem is when I type something like scrapy -V in my PyCharm terminal, it tells me that "zsh: command not found: scrapy", but when I launch my terminal outside PyCharm it works all right.

So I'm wondering if the path var is right. And then I tried echo $PATH in PyCharm terminal, it returns:

/usr/bin:/bin:/usr/sbin:/sbin

and the terminal outside PyCharm returns:

/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands

and I set shell path to: /bin/zsh

And by the way I'm IDEA too, but everything there works just fine, and the shell path is the same as what is in the PyCharm.

So, what is causing the path variable in my PyCharm terminal(zsh) to be wrong?

like image 418
Liang Avatar asked Jan 31 '17 14:01

Liang


People also ask

What is zsh shell path?

PATH is an environment variable where you tell your system to look for executables when you enter a command in the shell. You can inspect the value of the PATH variable by running the following. $ echo $PATH.

How do I run a terminal in PyCharm?

From the main menu, select View | Tool Windows | Terminal or press Alt+F12 .

Should I add PyCharm to path?

Install PyCharm It is not important to change the installation destination of the PyCharm application, but you could also change the destination to be directly on your C: similarly to the Python installation. However, we suggest simply going with the default path.


1 Answers

For me, adding this to the beginning of the ~/.zshrc file helped:

# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
like image 104
Daniel Dubovski Avatar answered Sep 20 '22 14:09

Daniel Dubovski