- Export existing env:
conda env export -n py27_bak > py27_bak.yml
- Modify the first line (name) (and last line(path), does not work) of
.yml
file:
name: py27_piv
...
- Create the new env:
conda env create -f py27_bak.yml -p /data/shared/conda_env/py27_piv
an pip subprocess with arguments:
['/data/shared/conda_env/py27_piv/bin/python', '-m', 'pip', 'install', '-U', '-r', '/home/xbao/condaenv.c9qp2cks.requirements.txt']
Pip subprocess output:
Pip subprocess error:
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: Could not find a version that satisfies the requirement spivet==1.0 (from -r /home/xbao/condaenv.c9qp2cks.requirements.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for spivet==1.0 (from -r /home/xbao/condaenv.c9qp2cks.requirements.txt (line 1))
CondaEnvException: Pip failed
add this in ~/.condarc
envs_dirs:
- /data/shared/conda_env/
so we can use
conda activate py27_piv
instead of
conda activate /data/shared/conda_env/py27_piv
- spivet and vtk5 cannot be done via pip, install them manually.
conda activate /data/shared/conda_env/py27_piv
cd ~/vtk5/vtk-build
module load gcc/5.5.0
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DVTK_WRAP_PYTHON=ON \
-DCMAKE_C_FLAGS=-DGLX_GLXEXT_LEGACY -DCMAKE_CXX_FLAGS=-DGLX_GLXEXT_LEGACY \
-DCMAKE_INSTALL_PREFIX=/data/shared/conda_env/py27_piv/ -Wno-dev \
-DPYTHON_INCLUDE_DIR=/data/shared/conda_env/py27_piv/include/python2.7 \
-DPYTHON_LIBRARY=/data/shared/conda_env/py27_piv/lib/libpython2.7.so \
../vtk-v5.10.1
make -j 112
make install
Then copy the vtk ld_library_path
settings to the new env:
cp /home/xbao/.conda/envs/py27_bak/etc/conda/activate.d/env_vars.sh /data/shared/conda_env/py27_piv/etc/conda/activate.d/env_vars.sh
cp /home/xbao/.conda/envs/py27_bak/etc/conda/deactivate.d/env_vars.sh /data/shared/conda_env/py27_piv/etc/conda/deactivate.d/env_vars.sh
And modify the path inside:
change the last line in activate.d/env_vars.sh
to
export LD_LIBRARY_PATH=/data/shared/conda_env/py27_piv/lib/vtk-5.10/:${LD_LIBRARY_PATH}
Then re-enter the env.
In spivet root dir, change /home/xbao/.conda/envs/py27_bak
in lib/spivet/pivlib/pivsimc.c
to /data/shared/conda_env/py27_piv
, then
python setup.py build
python setup.py install
cd tests
python run_tests.py
- Under user
zsc
:
add the dir in.condarc
, then,
conda create --clone py27_piv --p /home/zsc/.conda/envs/py27_piv_own
Don't forget to change pivsimc.c
:
PyRun_SimpleString("import sys;sys.path.append('/home/zsc/.conda/envs/py27_piv_own/lib/python2.7/site-packages/spivet/pivlib')");
PS:
Delete unwanted kernel:
jupyter kernelspec uninstall kernelname