tmuxと画面で環境変数を設定する問題

tmuxと画面で環境変数を設定する問題

tmuxまたはscreenセッションでTensorflow(Pythonライブラリ)を使用するたびに、環境変数を手動で変更する必要があります。具体的にはexport PATH blah blah blah合計を入力する必要がありますexport LD_LIBRARY_PATH blah blah blah。通常(tmuxと画面の外側)内の.bashrcには次のものが含まれているため、これを行う必要はありません。それはこれらの行です。

奇妙なことに、何らかの理由でsource ~/.bashrctmuxまたはscreenで実行すると、パス変数は更新されません。私の質問source ~/.bashrc.profile、tmuxとscreenに2つのエクスポートラインを自動的に実行させるにはどうすればよいですか?

編集:実行後、set -x; source ~/.bashrc印刷物の最後に次のように表示されます。

    ++ export 'PATH=/home/ajherman/anaconda3/bin:/usr/local/cuda-9.0/bin/home/ajherman/anaconda3/bin:/home/ajherman/anaconda3/bin:/usr/local/cuda-9.0/bin/usr/local/cuda-9.0/bin/home/ajherman/bin:/home/ajherman/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin}}}'
++ PATH='/home/ajherman/anaconda3/bin:/usr/local/cuda-9.0/bin/home/ajherman/anaconda3/bin:/home/ajherman/anaconda3/bin:/usr/local/cuda-9.0/bin/usr/local/cuda-9.0/bin/home/ajherman/bin:/home/ajherman/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin}}}'
++ export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64/usr/local/cuda-9.0/lib64:/home/ajherman/arrayfire-3/lib:/home/ajherman/arrayfire-3/lib
++ LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64/usr/local/cuda-9.0/lib64:/home/ajherman/arrayfire-3/lib:/home/ajherman/arrayfire-3/lib
++ bind TAB:menu-complete
++ export 'PATH=/home/ajherman/anaconda3/bin:/home/ajherman/anaconda3/bin:/usr/local/cuda-9.0/bin/home/ajherman/anaconda3/bin:/home/ajherman/anaconda3/bin:/usr/local/cuda-9.0/bin/usr/local/cuda-9.0/bin/home/ajherman/bin:/home/ajherman/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin}}}'
++ PATH='/home/ajherman/anaconda3/bin:/home/ajherman/anaconda3/bin:/usr/local/cuda-9.0/bin/home/ajherman/anaconda3/bin:/home/ajherman/anaconda3/bin:/usr/local/cuda-9.0/bin/usr/local/cuda-9.0/bin/home/ajherman/bin:/home/ajherman/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin}}}'
++ export 'PATH=/usr/local/cuda-9.0/bin/home/ajherman/anaconda3/bin:/home/ajherman/anaconda3/bin:/usr/local/cuda-9.0/bin/home/ajherman/anaconda3/bin:/home/ajherman/anaconda3/bin:/usr/local/cuda-9.0/bin/usr/local/cuda-9.0/bin/home/ajherman/bin:/home/ajherman/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin}}}}'
++ PATH='/usr/local/cuda-9.0/bin/home/ajherman/anaconda3/bin:/home/ajherman/anaconda3/bin:/usr/local/cuda-9.0/bin/home/ajherman/anaconda3/bin:/home/ajherman/anaconda3/bin:/usr/local/cuda-9.0/bin/usr/local/cuda-9.0/bin/home/ajherman/bin:/home/ajherman/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin}}}}'
++ export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64/usr/local/cuda-9.0/lib64/usr/local/cuda-9.0/lib64:/home/ajherman/arrayfire-3/lib:/home/ajherman/arrayfire-3/lib
++ LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64/usr/local/cuda-9.0/lib64/usr/local/cuda-9.0/lib64:/home/ajherman/arrayfire-3/lib:/home/ajherman/arrayfire-3/lib

ベストアンサー1

おすすめ記事