我在ubuntu 18上安装了python,可以像这样在终端上运行
~$ python3
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
并从任何目录点入。 但是当我打印路径变量时,我什么也没得到
~$echo $PYTHONPATH
~$
我无法使用
找到它printenv
另外,这是我的环境变量列表
LC_MEASUREMENT=en_US.UTF-8
LESSCLOSE=/usr/bin/lesspipe %s %s
LC_PAPER=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
XDG_MENU_PREFIX=gnome-
LANG=en_IN.UTF-8
DISPLAY=:0
INVOCATION_ID=c8708356c8624e88bc70d293fc616df0
GNOME_SHELL_SESSION_MODE=ubuntu
COLORTERM=truecolor
ZEITGEIST_DATA_PATH=/home/stain/.local/share/zeitgeist
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
J2SDKDIR=/usr/lib/jvm/java-10-oracle
XDG_VTNR=2
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
S_COLORS=auto
LC_NAME=en_US.UTF-8
XDG_SESSION_ID=2
DERBY_HOME=/usr/lib/jvm/java-10-oracle/db
DESKTOP_SESSION=ubuntu
QT4_IM_MODULE=xim
TEXTDOMAINDIR=/usr/share/locale/
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/*...
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
PWD=/home/USER
HOME=/home/USER
JOURNAL_STREAM=9:42470
TEXTDOMAIN=im-config
J2REDIR=/usr/lib/jvm/java-10-oracle
SSH_AGENT_PID=****
QT_ACCESSIBILITY=1
XDG_SESSION_TYPE=x11
XDG_SESSION_DESKTOP=ubuntu
LC_ADDRESS=en_US.UTF-8
DBUS_STARTER_ADDRESS=unix:path=/run/user/1000/bus,guid=*...
LC_NUMERIC=en_US.UTF-8
GTK_MODULES=gail:atk-bridge
PAPERSIZE=letter
WINDOWPATH=2
TERM=xterm-256color
VTE_VERSION=8888
SHELL=/bin/bash
QT_IM_MODULE=ibus
XMODIFIERS=@im=ibus
IM_CONFIG_PHASE=2
DBUS_STARTER_BUS_TYPE=session
XDG_CURRENT_DESKTOP=ubuntu:GNOME
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GNOME_TERMINAL_SERVICE=:8.888
SHLVL=1
XDG_SEAT=seat0
LANGUAGE=en_IN
LC_TELEPHONE=en_US.UTF-8
GDMSESSION=ubuntu
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=user
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus,guid=*...
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/run/user/1000/gdm/Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
PATH=/usr/lib/jvm/java-8-openjdk-
amd64/bin:/home/stain/.local/bin:/usr/local/sbin:/usr/local/bin:
/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:
/home/stain/.dotnet/tools:/usr/lib/jvm/java-10-oracle/bin:
/usr/lib/jvm/java-10-oracle/db/bin
LC_IDENTIFICATION=en_US.UTF-8
SESSION_MANAGER=local/STAIN:@/tmp/.ICE-unix/4139,unix/STAIN:/tmp/.ICE-
unix/4139
LESSOPEN=| /usr/bin/lesspipe %s
GTK_IM_MODULE=ibus
LC_TIME=en_US.UTF-8
_=/usr/bin/printenv
我如何知道python二进制文件的位置,因为我需要在 pycharm
中设置路径答案 0 :(得分:1)
PYTHONPATH指向库,如果您未添加任何自定义库路径,则为空。要查找python,请使用命令“哪个python”。