Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I need to use from kneed import KneeLocator for Knee-point detection in Python, but everytime I try to import the module after closing the Jupyter notebook I always get ModuleNotFoundError: No module named 'kneed' error and I am forced to install it again. I am using Jupyter Notebook with Anaconda on a remote server that I do not have the access to. I am using its web client.

The module I am trying to install and use is from https://github.com/arvkevi/kneed

I have not faced this issue with any other libraries. All other libraries I just need to install just once.

What could be the reason behind that?

Could anybody help me understand why is it happening and how to solve this issue?

The current best practice with running pip in a cell in a notebooks is to use %pip install <rest of command goes here> . The magics insure that things get installed to the same environment where the notebook's environment is based. An exclamation point doesn't 100% insure that and can lead to issues. The same magics have been added for conda, too. See here for more about these newer magic commands. Wayne Apr 3, 2022 at 3:01

According the information you provide, you are using python3.X . try "python3 setup.py install" instead of "python setup.py install". After you install the module, run python3 -c "help('help;)" to confirm you install the module successfully.

Thanks Shawn, but I did get the module installed properly. It is only that after closing the jupter notebook every-time i try to import the module it gives me the same issue. So the installation which was done earlier correctly doesn't hold for the next time I open the notebook after closing it. I hope it makes the issue more clear. skip Jun 14, 2019 at 7:12

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .