the problem I ran into was not installing the package in the virtual environment, taking the jieba package as an example
enter python in the virtual environment, and then you can import the package. We thought it was packaged, but it was actually installed in the basic environment.
USES conda list to view the packages in the current environment, there is no jieba package.
forgot the screenshot,,,,
so you need to install jieba using the PIP of the virtual environment.
after confirming wrapping in a virtual environment, switching to a python environment cannot be done by simply typing python commands. Instead, use virtual environment Python, just like the previous PIP.
for example, you now have two files, test.py and test.sh.
import torch print(torch.__version__)
you can see that the PIP version printed in the virtual environment is different from the one printed in the bash script.
so while I installed jieba in the pytorch1.4 environment, the command I used directly was not python in pytorch1.4, but python in the base environment.
- whether the package to the environment
- used the python interpreter is not the package environment interpreter
there are a lot of ways to do it online, so this is a supplement to what’s possible.
- ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
- Pytorch: How to Handle error warning conda.gateways.disk.delete:unlink_or_rename_to_trash(140)
- Install PyTorch in Anaconda environment
- Conda Install Library Error: failed with initial frozen solve. Retrying with flexible solve.
- ModuleNotFoundError: No module named ‘tensorflow.python’ And the pits encountered after installation
- Pytorch ValueError: Expected more than 1 value per channel when training, got input size [1, 768
- Python ImportError: numpy.core.multiarray failed to import
- Here is the difference and connection of Torch. View (), Transpose (), and Permute ()
- Extracting TF-IDF keywords from text using Jieba
- error: Unable to find vcvarsall.bat
- Using Python error urlopen error unknown URL type: the solution of HTTPS
- [How to Fix]RuntimeError: Python is not installed as a framework, If you are using (Ana)Conda
- How to Fix Errors encountered in executing Python scripts with command line parameters
- Solution for Python3.7 import gevent module error
- Python custom convolution kernel weight parameters
- About the solution of ERROR: Failed building wheel for dlib
- Python 3 uses the relative path import module
- Windows10 DOTA_devkit Error: TypeError: ‘＞=‘ not supported between instances of ‘NoneType‘ and ‘str‘
- Python3 Error: Cannot uninstall ‘numpy’. It is a distutils installed project and thus we cannot accurate
- Import win32API; importerror: DLL load failed: the specified program was not found