(Original) Configure pycharm + python_pcl environment configuration tutorial under Win10 environment!

Write first! !
There are a lot of python_pcl tutorials written on the Internet, but almost no one is a complete writing process from beginning to end. . . Today I plan to write a complete process after stepping on the pit, and the remaining friends will step on the pit again. . . (I have never seen such a hard-to-install library)
Bloggers use python_pcl in linux in school, so installing the wheel directly is done, but the epidemic is trapped at home and you still have to learn. . . . Helplessly installed a computer with a win10. Need to reinstall the library, the following list is a complete stepping process. . Follow the rough tutorial on github.
***

High-energy tip: The following environments and dependent versions have a lot of collocations, no need to use them randomly, everyone can use the same as bloggers for the sake of saving trouble, surely no problem!


1. First go to github and download the source code of python_pcl. The traditional door is here.
2. Configure the python compilation environment. I use the more convenient anaconda software. Just go to the official website to download the latest one. The portal is then installed here.
3. After installation, go to conda prompt to configure python environment. First create a new env. It is the default base when you first come in. It is recommended not to directly operate on the base, and it may be very messy to use it later.
Insert picture description here
3.1, create a new env, the name is py36, the selected python version is python3.6 ()

conda create -n py36 python=3.6

Then after a while, the basic environment will be configured.

3.2, activation environment

activate py36

Insert picture description here
Install required dependencies in the environment

pip install cython
pip install numpy

4. You need to download and install the c ++ version of pcl, select version 1.9.1, the portal is here.
Just look at the picture, cut this one
You can install it directly after downloading. There is no other operation. Note that there is an option to add a path for all users.
After the installation, a third-party library will be installed, which can be installed directly by default.
5. Install Visual Studio 2017 C ++ compilation tools. This can be downloaded on the official website, here posted a picture and portal . The version must be optimistic about 2017! ! !
Insert picture description here
Just download this thing on the picture, the portal is on it, just install it directly, and you need to restart after installation! .
6. Download gtk + portal here, don't ask, just download it.
Insert picture description here
After downloading, unzip and copy all the contents of the bin folder to the pkg_config / bin folder in the python-pcl folder. This step is completed.
7. Set environment variables. emm, in my computer-advanced system settings-environment variables. Need to set the following, specific reference to their file installation location.
7.1. The first one:

PCL:ROOT=C:\Program Files\PCL 1.9.1

7.2 Second:

PKG_CONFIG_PATH=
C:\Program Files\PCL 1.9.1\lib\pkgconfig
C:\Program Files\PCL1.9.1\3rdParty\FLANN\lib\pkgconfig
C:\Program Files\PCL 1.9.1\3rdParty\Eigen\lib\pkgconfig

7.3, the third:

OPENNI2_INCLUDE64=C:\Program Files\OpenNI2\Include\
OPENNI2_LIB64=C:\Program Files\OpenNI2\Lib\
OPENNI2_REDIST64=C:\Program Files\OpenNI2\Redist\

7.4, the fourth:

path=
C:\Program Files\PCL 1.9.1\3rdParty\Qhull\bin
C:\Program Files\PCL 1.9.1\3rdParty\FLANN\bin
C:\Program Files\OpenNI2\Samples\Bin
C:\Program Files\OpenNI2\Redist
C:\Program Files\OpenNI2\Tools
C:\Program Files\PCL 1.9.1\3rdParty\VTK\bin
C:\Program Files\PCL 1.9.1\3rdParty\Boost\lib
C:\Program Files\PCL 1.9.1\bin

Some of the above have already existed during installation. If it does not exist, you must enter it manually. Otherwise, you will report an error later. If you do not report an error, you may have fewer dll files. . Don't ask me how I know. . .

8. You can finally compile. . Back in the py36 environment, enter the following code:

python setup.py build_ext -i
python setup.py install

Then wait for it to be installed. If there is an error about boost in the middle, it is the wrong VC ++ version, or you have not restarted after installation.
After the installation is complete, you can go to pycharm to code.
9. Create a new pycharm project. The environment selects conda's py36. Then create a new python file.
Enter the following code: If no error is reported, you will be successful!

import pcl
import pcl.visualization

Postscript: The win version does not correspond to the wheel that can be directly used for direct installation, and all need to be compiled in this way. Mac and Linux can directly download the wheel, and it was successfully disgusted. What needs to be added, I will write it directly below.

If you have any questions, you can leave a message below. I will reply to you when I see it.

Typing is not easy, please indicate the source when reprinting, do not use for commercial purposes.

Published 3 original articles · Likes2 · Visits 1510

Guess you like

Origin blog.csdn.net/l494924841/article/details/105622454