0

Recently I am facing a embrassing problem is that some Python packages must install using pip. I have read the pip and conda difference:

I think many people facing the same problem that when you choose conda, then some package could not using conda install, when you use pip install the pacakge, it could not imported into the local project because the project only could import pakcage installed by conda install command. For example I want to use eyeD3 to read the mp3 meta data, but the package could not installed by conda, I installed the package using pip but could not import in the PyCharm IDE. What is the best way to solve this conflict? Am I missing something? Or I have to switch to pip? is it possible to make conda could install package from pip? Any suggestion is welcome, I want to fetch a guidline. I have tried install package like this in the macOS Big Sur:

/usr/local/anaconda3/envs/pydolphin ⌚ 22:20:21
$ ./bin/python -m pip install eyed3                                                                                          ‹ruby-2.7.2›
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: eyed3 in ./lib/python3.9/site-packages (0.9.6)
Requirement already satisfied: filetype<2.0.0,>=1.0.7 in ./lib/python3.9/site-packages (from eyed3) (1.0.8)
Requirement already satisfied: coverage[toml]<6.0.0,>=5.3.1 in ./lib/python3.9/site-packages (from eyed3) (5.5)
Requirement already satisfied: deprecation<3.0.0,>=2.1.0 in ./lib/python3.9/site-packages (from eyed3) (2.1.0)
Requirement already satisfied: toml in ./lib/python3.9/site-packages (from coverage[toml]<6.0.0,>=5.3.1->eyed3) (0.10.2)
Requirement already satisfied: packaging in ./lib/python3.9/site-packages (from deprecation<3.0.0,>=2.1.0->eyed3) (21.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in ./lib/python3.9/site-packages (from packaging->deprecation<3.0.0,>=2.1.0->eyed3) (3.0.6)
(base)

still could not import this pakacage in the PyCharm IDE. I could found the package from the env:

/usr/local/anaconda3/envs/pydolphin/lib/python3.9/site-packages/eyed3

enter image description here

Dolphin
  • 29,069
  • 61
  • 260
  • 539
  • 2
    Use `/path/to/conda/env/python -m pip install`. Conda envs are just folders, and there is a python.exe (`python` if not Windows) in that folder. So go to the conda env, activate it, and then explicitly call the env python when using pip. (Those 3 steps in a terminal/console) – 2e0byo Dec 04 '21 at 13:54
  • what is `conditions-m`? @2e0byo I did not search any imformation about conditions-m from google. – Dolphin Dec 04 '21 at 13:55
  • it's a stupid autocorrect error on my phone, sorry. Fixed niw – 2e0byo Dec 04 '21 at 13:57
  • 2
    see also https://www.anaconda.com/blog/using-pip-in-a-conda-environment – 2e0byo Dec 04 '21 at 14:13
  • 1
    Possible typo: The script shows `import eyeD3`, but the documentation for that package shows the module is `eyed3` (all lowercase). – merv Dec 06 '21 at 04:54

0 Answers0