Sohail
Sohail

Reputation: 319

anaconda could not find my already installed package

I am trying to install doconce through the clone: https://github.com/hplgit/doconce

using: sudo python setup.py install

This installs successfully and which doconce returns

> /usr/local/bin/doconce.

The problem is that I have anaconda along with regular installation of python. which python returns:

>/home/sohail/anaconda/bin/python

Now when I try to run test.verify from /test, it says:

> Traceback (most recent call last):
  File "test.verify", line 13, in <module>
  import commands, os, sys, re, doconce.common, time
  ImportError: No module named doconce.common

As a second test, I created a do.txt file(doconce file) and when I try to convert it to latex, for example it says:

> ImportError: No module named mistune

Though the package python package mistune is already installed, as shown by locate mistune which returns:

> /home/sohail/anaconda/conda-meta/mistune-0.5.1-py27_0.json
> /home/sohail/anaconda/lib/python2.7/site-packages/mistune-0.5.1-py2.7.egg-info
> /home/sohail/anaconda/lib/python2.7/site-packages/mistune.py
> /home/sohail/anaconda/lib/python2.7/site-packages/mistune.pyc
> /home/sohail/anaconda/pkgs/mistune-0.5.1-py27_0
> /home/sohail/anaconda/pkgs/mistune-0.5.1-py27_0/info
> /home/sohail/anaconda/pkgs/mistune-0.5.1-py27_0/lib
> /home/sohail/anaconda/pkgs/mistune-0.5.1-py27_0/info/files
> /home/sohail/anaconda/pkgs/mistune-0.5.1-py27_0/info/index.json
> /home/sohail/anaconda/pkgs/mistune-0.5.1-py27_0/info/meta
> /home/sohail/anaconda/pkgs/mistune-0.5.1-py27_0/info/requires
> /home/sohail/anaconda/pkgs/mistune-0.5.1-py27_0/lib/python2.7
> /home/sohail/anaconda/pkgs/mistune-0.5.1-py27_0/lib/python2.7/site-packages
> /home/sohail/anaconda/pkgs/mistune-0.5.1-py27_0/lib/python2.7/site-packages/mistune-0.5.1-py2.7.egg-info
> /home/sohail/anaconda/pkgs/mistune-0.5.1-py27_0/lib/python2.7/site-packages/mistune.py
> /home/sohail/anaconda/pkgs/mistune-0.5.1-py27_0/lib/python2.7/site-packages/mistune.pyc

I have certain idea about the problem that is when I run some python code, the python from anaconda is used but the when I try to run tests or .do.txt files(doconce files) it looks for my python compilier outside anaconda, since doconce is not installed inside anaconda or as a part of anaconda which is the problem. So how can I make this work, in summary how can I include doconce to anaconda???

Upvotes: 2

Views: 1929

Answers (1)

Sohail
Sohail

Reputation: 319

The doconce at pypi is outdated and the authors have little interest in updating due to large dependency base of doconce, therefore the use of conda skeleton as suggested by @asmeurer in non_recipe_ananconda_installation is of little interest in this particular problem.

I also tried pip install -e git+https://github.com/hplgit/doconce#egg=doconce with and without sudo. With sudo the install is successful but not as a part of anaconda and without sudo it leads to a weird error of:

error: cannot open .git/FETCH_HEAD: Permission denied

This is what that finally works. First delete all the files installed by sudo python setup.py install by using --record=myfile.txt.

Now go to the cloned doconce repository and do python setup.py install --prefix=/home/sohail/anaconda/ --record=myfile2.txt.

This successfully installs doconce as a part of anaconda default environment. Now you can check that python can also accept doconce as its module but doing python -c 'import doconce' and sys.modules['doconce']. Moreover you can also verify the installation by running the tests in doconce\test, but keep in mind doconce requires too many dependencies. Luckily the owner has made test_mintest.py to verify the minimal installation of doconce.

In the last you can check conda list | grep doconce to verify that doconce is indeed a package now part of anaconda.

This procedure was tested to install doconce and logg-publish as a part of anaconda.

Upvotes: 1

Related Questions