Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't set up conda environment correctly for ocropus #338

Closed
norahvii opened this issue Nov 27, 2020 · 1 comment
Closed

can't set up conda environment correctly for ocropus #338

norahvii opened this issue Nov 27, 2020 · 1 comment

Comments

@norahvii
Copy link
Contributor

https://github.com/ocropus/ocropy
was built in WSL2 using the following commands:

$ conda create -n ocropus_env python=2.7
$ source activate ocropus_env $ conda install --file requirements.txt
$ wget -nd https://github.com/zuphilip/ocropy-models/raw/master/en-default.pyrnn.gz
$ mv en-default.pyrnn.gz models/ $ python setup.py install

however I encounter some unexpected behavior...

  1. the command ipython launches Python 3.8.3 and not the 2.7 version
  2. from within the ipython interpreter my site-packages are referring to the wrong folder

In [1]: from distutils.sysconfig import get_python_lib
In [2]: print(get_python_lib())

rather than the site-packages existing in the expected directory, which would look like this:
/mnt/d/anaconda3/envs/ocropus_env/lib/python2.7/site-packages
running the code above shows it's location here:
/mnt/d/anaconda3/lib/python3.8/site-packages

in fact the site-packages are contained within the folder:
/mnt/d/anaconda3/envs/ocropus_env/lib/python2.7/site-packages

i cannot figure out what command to type to produce an ipython or python interpreter which will refer back to the correct site-packages directory.

i also cannot figure out how to test the recognizer with the prescribed ./run-test command. typing ./run-test only produces the output: : invalid option

@norahvii
Copy link
Contributor Author

norahvii commented Dec 3, 2020

This matter was resolved by me.
Recommendations: DO NOT INSTALL BY MEANS OF SOURCE ACTIVATE.
source activate ocropus_env is .cmd syntax and may point to the wrong conda.
I was using WSL in this case, so I needed to type conda activate ocropus_env instead.
Supplemental recommendation (if you encounter this issue):

If you are using zsh get out. type:
/bin/bash
conda create -n ocropus_env python=2.7
conda activate ocropus_env
conda install requirements.txt
python setup.py install clean
./run-test

@norahvii norahvii closed this as completed Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant