theanoをimportしたら以下のような変なエラーが出たので、
Exception: Compilation failed (return status=1): /usr/bin/ld: /home/aho/.pyenv/versions/3.6.4/lib/libpython3.6m.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC. /home/aho/.pyenv/versions/3.6.4/lib/libpython3.6m.a: error adding symbols: Bad value. collect2: error: ld returned 1 exit status.
pythonを-enable-sharedオプションを付けてビルドしようとしたところ、
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.6.5
今度は以下のようなさらに変なエラーが吐き出された。
pyenv: tar: command not found
The `tar' command exists in these Python versions:
anaconda3-5.1.0/envs/py36
The `tar' command exists in these Python versions:
anaconda3-5.1.0/envs/py36
ネットで調べても解決策には行き当たらず、仕方ないのでpython buildを試してみた。
env PYTHON_CONFIGURE_OPTS="--enable-shared" python-build 3.6.5 /home/aho/.pyenv/versions/3.6.5
今度は上手くビルドが出来たので、virtualenvで新しい環境を構築した。
pyenv virtualenv 3.6.5 py365
新しい環境に古い環境をコピーするには以下のようにすればいい。
pip freeze > requirements.txt #古い環境のmoduleをコピー
pip install -r requirements.txt #新しい環境にmoduleをインストール
pip install -r requirements.txt #新しい環境にmoduleをインストール
これで古い環境から新しい環境への引越し作業は終了。
スポンサーリンク
スポンサーリンク