Python模块搜索路径设置 Python环境变量设置
来源:互联网 发布:qq群关系数据库 种子 编辑:程序博客网 时间:2024/05/17 14:21
「验证失败」
Ubuntu add directory to Python pathhttp://stackoverflow.com/questions/16913086/ubuntu-add-directory-to-python-path
Create a .bash_profile
in your home directory. Then, add the line
PYTHONPATH=$PYTHONPATH:new_dirEXPORT $PYTHONPATH
Or even better:
if [ -d "new_dir" ] ; then PYTHONPATH="$PYTHONPATH:new_dir"fiEXPORT $PYTHONPATH
The .bash_profile
properties are loaded every time you log in.
The source
command is useful if you don't want to log in again.
附:
What's the difference between .bashrc, .bash_profile, and .environment?
http://stackoverflow.com/questions/415403/whats-the-difference-between-bashrc-bash-profile-and-environmentThe main difference with shell config files is that some are only read by "login" shells (eg. when you login from another host, or login at the text console of a local unix machine). these are the ones called, say,.login
or.profile
or .zlogin
(depending on which shell you're using).
Then you have config files that are read by "interactive" shells (as in, ones connected to a terminal (or pseudo-terminal in the case of, say, a terminal emulator running under a windowing system). these are the ones with names like.bashrc
,.tcshrc
,.zshrc
, etc.
bash
complicates this in that .bashrc
is only read by a shell that's bothinteractive andnon-login, so you'll find most people end up telling their.bash_profile
to also read.bashrc
with something like
[[ -r ~/.bashrc ]] && . ~/.bashrc
Other shells behave differently - eg with zsh
, .zshrc
is always read for an interactive shell, whether it's a login one or not.
The manual page for bash explains the circumstances under which each file is read. Yes, behaviour is generally consistent between machines.
.profile
is simply the login script filename originally used by /bin/sh
. bash
, being generally backwards-compatible with /bin/sh
, will read .profile
if one exists.
FILES /bin/bash The bash executable /etc/profile The systemwide initialization file, executed for login shells /etc/bash.bashrc The systemwide per-interactive-shell startup file /etc/bash.bash.logout The systemwide login shell cleanup file, executed when a login shell exits ~/.bash_profile The personal initialization file, executed for login shells ~/.bashrc The individual per-interactive-shell startup file ~/.bash_logout The individual login shell cleanup file, executed when a login shell exits ~/.inputrc Individual readline initialization file
- Python模块搜索路径设置 Python环境变量设置
- 设置Python包搜索路径
- python模块库路径设置
- 设置python 模块调用路径
- python中环境变量,默认路径设置
- Python 模块搜索路径
- Python模块搜索路径
- python模块搜索路径
- Python 模块搜索路径
- Python环境变量设置
- python环境变量设置
- linux设置python环境变量
- linux设置python环境变量
- python环境变量的设置
- Python环境变量设置问题
- python 设置linux环境变量
- 使用Python设置环境变量
- Python环境变量PYTHONPATH设置
- urlrewrite 自定义ruleclass
- c# 事件方法与窗口或控件的绑定
- LeetCode Combinations
- 找不到 !!! 。。。。
- 装逼第三弹——卷积的意义
- Python模块搜索路径设置 Python环境变量设置
- iframe子父页面调用
- Eclipse颜色设置
- java io流整理
- 黑馬程序員——代 理
- 学生管理系统
- hibernate 选用ibatis和hibernate的区别
- Andengine的自动视差背景AutoParallaxBackground(背景移动)
- 转发与重定向的区别