0

I'm relatively new on dealing with python libraries so it might be a stupid question but here is the detailed problem:

I'm working on Linux and trying to use a python program (ORF-rater) using python 3.7. Unfortunately, when I run the program, I get the following error:

ImportError: cannot import name 'maketrans' from 'string' 

which I think is related to this issue. Therefore I want to use another version of Python (3.4 or 2.7 for instance) that will support this maketrans.

The program that I'm using also uses the Python package plastid, which I installed using Conda conda install -c bioconda plastid which I guess worked well.

However, it installed the package on python 3.7 only, and I can't find a way to install for python 3.4 (I tried others things as pip3.4 install plastid, but it did not work, most likely because I'm working on an university server and I don't have permission to do it).

In brief, how do I install a package using Conda for a specific version of Python (3.4)?

elielink
  • 1,174
  • 1
  • 10
  • 22

1 Answers1

1

The following code creates an environment with a specific python version (2.7 since 3.4 was not an option), then you activate it and install the package you need.

conda create -n test python=2.7
conda activate test 
conda install -c bioconda plastid
python

Then in Python, I did the following and got no errors

from string import maketrans
phuycke
  • 346
  • 2
  • 10
  • It's always better to do it in one command: `conda create -n test -c conda-forge -c bioconda python=2.7 plastid` No reason to have the solver run twice. – merv Aug 11 '21 at 14:25