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?
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.
From the main menu, select View | Tool Windows | Terminal or press Alt+F12 .
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With