Search code examples
pythonlinuxapt-getxmltodict

Add package to specific install of Python in Linux


I am trying to add xmltodict package to Python on Linux.

I have 2 installations of Python on my Linux build; Python 2.7 (default) and Python 3.5 (in the form of an Anaconda installation). I want to add xmltodict to the Python 3 installation, but when I use sudo apt-get install python-xmltodict it adds it to the default Python 2.7 installation.

How can I get apt to add this package to my Python 3 installation without changing the default or using pip? I do not want to have to rebuild my installation with a virtual environment either


Solution

  • You could use conda for the installation

    conda install -c conda-forge xmltodict=0.11.0
    

    This should work