0

I combined following commands on ubuntu:

conda create -n ml python=3.9
conda activate ml 
conda install jupyter pandas graphviz python-graphviz 
pip install git+https://github.com/MaxHalford/vose
pip install git+https://github.com/MaxHalford/hedgehog
python -m ipykernel install --user --name=ml 
jupyter notebook 

But when I try to execute python code on jupyter, it already stops at importing hedgehog:

ModuleNotFoundError: No module named 'hedgehog'

When I take a look on conda list it doesn't find the module hedgehog, but the installation went withour errors. I'm not sure what can go wrong within a conda environment. All other modules can be found within conda list.

I thought about maybe permissions, so I tried it with sudo pip install:

ERROR: Package 'sorobn-0.1.0' requires a different Python: 3.8.10 not in '>=3.9,<4.0'

Which doesn't make a lot of sense to me, since I specified python 3.9 for the env and python -V confirms that I am using 3.9. So maybe that's the wrong approach. Do you have an idea?

  • Does this answer your question? [What is the difference between pip and conda?](https://stackoverflow.com/questions/20994716/what-is-the-difference-between-pip-and-conda) – medium-dimensional Jan 20 '23 at 08:22
  • 2
    **Do not ever use `sudo` for pip unless you are absolutely sure you know what you are doing. Definitely do not use it because something is wrong and you think it might possibly help.** If Python came with your system, it is very likely that your operating system depends on it in any number of untraceable ways, and interfering with that installation in any way can cause serious damage. The system Python installation may deliberately not even include `pip` in some cases. If `sudo` is required to run `pip` then that's because the `pip` command is pointing at a pip within a system installation. – Karl Knechtel Jan 20 '23 at 08:32
  • When running a `pip` that is in a system installation of Python, instead add the `--user` option for installation commands, to put new packages in a per-user location rather than globally affecting Python. At any rate, `pip`'s permissions can only possibly be an issue *while `pip` is running*, so if that were the problem, you would have seen errors *from the installation process*. – Karl Knechtel Jan 20 '23 at 08:37
  • "Which doesn't make a lot of sense to me, since I specified python 3.9 for the env and python -V confirms that I am using 3.9" - you noticed the version numbering issue, but didn't notice that it mentioned a different package name from the one you thought you needed? – Karl Knechtel Jan 20 '23 at 08:38

1 Answers1

2

The module hedgehog doesn't exist because the installed module is sorobn.

If you go to https://github.com/MaxHalford/hedgehog, you will be redirect to https://github.com/MaxHalford/sorobn

Use:

import sorobn
Corralien
  • 109,409
  • 8
  • 28
  • 52