We describe below how to use pymovies_3D in an ad-hoc Anaconda environment with a Python 3 interpreter and the Spyder integrated development environment (IDE). Using the pyCharm IDE under Linux is not supported yet, due to this bug. NB : when installing Anaconda, it is adviced to select the "Add to path" option if you have administration rights on your computer.
Clone the GitLab repository in the [pymovies_3d _folder] of your choice, with the recursive option:
git clone https://gitlab.ifremer.fr/fleet/movies/pymovies_3d.git --recursive
WARNING The MOVIES3D libraries are stored in a separate repository. The git clone recursive option is used to ensure that they are linked to the pymovies_3D repo via git submodules.
If you did not use the recursive option in the first place, type the following commands in a git terminal:
git submodule update --init
Create a custom pymovies_3D conda environment
Create your development environment using the 'create_anaconda_environments.py' script located in the 'requirements' directory.
Refer to this page for detailed infos on custom conda environments
Open a terminal
Type the following commands to create the custom conda environment:
cd [path_to_pymovies_3d _folder]/pymovies_3d cd requirements python create_anaconda_environments.py -t dev
The new conda environment will be created at: [user_path].conda\envs\pymovies_3D_dev
- Open a conda terminal
Tip: type Anaconda in the Search box and choose Anaconda Prompt from the list (Python3 must be installed and present in the Windows PATH):
- Type the following commands in a conda terminal to create the custom conda environment:
cd [path_to_pymovies_3d _folder]/pymovies_3d cd requirements python.exe create_anaconda_environments.py -t dev
Three new conda environments (pymovies_3D_dev, pymovies_3D_runtime, pymovies_3D_test) will be created at: [user_path]\Anaconda3\envs.
Set up pymovies_3d - MOVIES3D libraries link
Add the path to the pymovies_3d repository clone to the PYTHONPATH of your IDE ([path_to_pymovies_3d_folder])
- Set the Python interpreter:
- Go to: Tools/Preferences
- Select the python interpreter in the custom "pymovie_3D_dev environment"
- Add MOVIES3D libraries to PYTHONPATH
- Go to: Tools/PYTHONPATH manager
- Add the [path_to_pymovies_3d_folder] to the PYTHONPATH
** NB: Be carefull as adding another path to pymovies_3d functions in the PYTHONPATH will mess up your configuration (e.g. while working with Spyder projects) **
In Pycharm: under Windows only
- Create a new project using the Python interpreter in the pymovies_M3D custom conda environment:
- Go to: File/New Project
- Enter project name in path
- Click Down arrow, choose "Existing interpreter"
- Browse to python.exe file in the custom pymovies_3D conda environment
- Add MOVIES3D libraries to the new project
- Go to: File/Settings/Project/Project structure
- Click on "Add content root" and add the [path_to_pymovies_3d _folder]
- Restart Pycharm
- Load the "pyMovies_3D" modules
Import basic pyMovies module by running in the python console:
from pymovies.pyMovies import *
from pymovies_3d.core.echointegration.ei_survey import ei_hacfile
to load the "ei_hacfile" module from ei_survey.py script in the [path_to_pymovies_3d _folder]/pymovies_3d/core/echointegration/ sub-folder