Search code examples
minicondapython-3.11

How can I "relocate" my pytamaro-library to Python 3.11 outside miniconda?


This is my very first post here!

I am working with a MacBook Pro and at the moment I am using a python library called pytamaro. In my system it's found in this path: /Applications/miniconda3/lib/python3.9/site-packages/pytamaro That's why I can use it in VS Code with Python3.9 but not with Python3.11.

What do I need to do to use pytamaro with Python3.11 in VSCode?

Thank you very much for your help!

enter image description here

After a Google search I still do not know what to do...


Solution

  • To directly answer your question How can I "relocate": you don't. It is a bad idea to move installed python modules from one python version to another. It might work and there are probably numerous "tutorials" online that suggest to do something like this it is a recipe for trouble and might also simply not work, esspecially when you have modules that are not pure python.

    Adressing the underlying problem of enabling you to use the module with python 3.11, there are two solutions:

    1. Install the module to your other python /usr/local/bin/python3 -m pip install pytamaro should give you that module. However, I would say that using your miniconda and your system python alongside like that is not a very clean solution, therefore, I would recommend to do:
    2. Create a python 3.11 environment conda create -n py311 python=3.11, activate it conda activate py311 and install your module pip install pytamaro. Then select that environment's interpreter in visual studio code. This leaves your system's python untouched and if anything goes wrong, you can just recreate your environment rather than trying to fix your OS