Python setup in IDE
Dear Team, I was looking at various instructions given on CloudComPy wrapper in GitHub to install cloudComPy, however I am unsuccessful. I want to install cloudComPy in one of the Anaconda IDE (For. e.g. Spyder, Jupyter). I am quite new to python, however know few package installations techniques like conda install/ pip install / adding the path in Tool>PythonPath Manager. My intention is to repeat below steps done in software in python, as I need to do it for more than 10 such pair of stl files. Steps to automate in cloud compare:
- Import two stl files (reference, new model)
- Fine registration (ICP) (default settings with 100% final overlap)
- Save the Registration info image/csv respective new model location
- Measure cloud/mesh distance with default settings
- Compute stat. params(active SF) gaussian distribution fitting
- Save gaussian distribution plot in respective new model location
- Save new model modified stl (which was transformed for step 2 by the software) I know how to loop these steps in python. I am unable to import cloudCompy as cc to try building my steps in python. Do you think these steps can be done in python wrapper of the software? Any suggestion is welcome.
Hello, I have never tried to use CloudComPy with an Anaconda IDE (I only use Anaconda and especially conda to provide the set of packages used to build CloudComPy). A first attempt to add spyder in my conda environment brings up package conflicts. I'll see if I can make a new conda environment that is compatible with the IDEs. Otherwise, what you want to do with CloudComPy seems possible, I think there is everything you need in the interface. It should work if you install CloudComPy without the IDE. If you find something missing, say so! Are you using Windows or Linux (I don't know if it makes a difference for IDE integration).
Hello, The new release of CloudComPy (December 5, 2021) works with Spyder and Jupyter, on Windows and Linux. Let me know if you have any problems or suggestions for improvement. Regards.
Hi, Thank you for the update, I tried to install the new environment and follow steps as in below link to run the test scripts. https://github.com/CloudCompare/CloudComPy/blob/master/doc/UseWindowsCondaBinary.md
Below is the log file for first test, similarly I got for remainder of the tests. How do I install cloudComPy onto the environment created?
Start testing: Dec 08 09:35 Malay Peninsula Standard Time
1/27 Testing: PYCC_test001 1/27 Test: PYCC_test001 Command: "C:/ProgramData/Anaconda3/envs/CloudComPy39/doc/PythonAPI_test/execTest.bat" "test001.py" Directory: C:/ProgramData/Anaconda3/envs/CloudComPy39/doc/PythonAPI_test "PYCC_test001" start time: Dec 08 09:35 Malay Peninsula Standard Time Output:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\CloudComPy39\doc\PythonAPI_test\test001.py", line 24, in
from gendata import getSampleCloud, dataDir, isCoordEqual
File "C:\ProgramData\Anaconda3\envs\CloudComPy39\doc\PythonAPI_test\gendata.py", line 6, in
import cloudComPy as cc
ImportError: DLL load failed while importing cloudComPy: The specified module could not be found.
"Python exit code = 1"
Test time = 0.37 sec
Test Failed. "PYCC_test001" end time: Dec 08 09:35 Malay Peninsula Standard Time "PYCC_test001" time elapsed: 00:00:00
Hi, There is a PATH problem, I can't reproduce it on my computers for the moment. I don't quite understand your traceback: it looks like you installed CloudComPy in the Anaconda3 directory. I'm not sure if this is a good idea. Could you execute the following commands and give me the results ? in the anaconda prompt, cd to your install of the CloudComPy binary, activate the anaconda environment and print the PATH:
cd \projets\CloudComPy\test\CloudComPy39
conda activate CloudComPy39
echo %PATH%
Then, execute envCloudComPy.bat and print the PATH
envCloudComPy.bat
echo %PATH%
echo %PYTHONPATH%
Could you also reexecute the ctest in verbose mode for the first test and give me of the result ?
ctest -VV -R test001
In my Windows scripts, I sometimes mix up the Windows directory separators '\' and the linux ones '/'. I don't think this is a problem here, but a test might be to replace the envCloudComPy.bat script with :
rem this script sets the environment for CloudComPy. The Conda environment must be activated before calling this script.
@echo off
@set SCRIPT_DIR=%~dp0
@set CLOUDCOMPY_ROOT=%SCRIPT_DIR%
@set QT_PLUGIN_PATH=%CLOUDCOMPY_ROOT%\qtplugins
@set PYTHONPATH=%CLOUDCOMPY_ROOT%\CloudCompare;%PYTHONPATH%
@set PYTHONPATH=%CLOUDCOMPY_ROOT%\doc\PythonAPI_test;%PYTHONPATH%
@set PATH=%CLOUDCOMPY_ROOT%\CloudCompare;%CLOUDCOMPY_ROOT%\ccViewer;%SCRIPT_DIR%;%PATH%
in doc/PythonAPI_test, the scripts envPyCC.bat and execTest.bat should also be modified accordingly.
Regards
Hi dheejda, I'd like to use something similar to your cloudCompare automation in my project. Do you mind sharing your python code ?
Thanks in advance