0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

pythonで読み込まれるモジュールのパスを変えたい

Posted at

Anacondaでモジュールがインストールされる場所とpythonのインタープリンタでモジュールが読み込まれる場所が違って困ったのでメモしておく。

解決策はpythonのインタープリンタで読み込むモジュールのパスを変更すること。
いくつか3つほど方法があるみたい。

  1. 環境変数PYTHONPATHを設定する。
    この方法だとほかの仮想環境にも影響してしまう?
    しかも多分もっとも優先順位が高いパスになってしまう?
  2. .pthファイルを作る。
    この方法だとほかの仮想環境にも影響してしまう?
  3. sysモジュールのsys.path.append()を用いる。
    この方法だとインタープリンタを立ち上げる度にしてしなければいけない?

pythonやRのバージョン依存性はなかなか厄介だ...

参考:

0
0
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?