This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to run pygraphviz on macOS in conda

I'm new to bioinformatics, and am trying to install pygraphviz, but have run into problems. I've tried searching for solutions, but can't work it out. I'm working in mac terminal.

The advice I got was:

source activate bioinfo

... which works well

conda install pygraphviz

which outputs:

DirectoryNotACondaEnvironmentError: The target directory exists, but it is not a conda environment.
Use 'conda create' to convert the directory to a conda environment.
  target directory: /Users/michaelflower/miniconda3/envs/bioinfo

 

pip install goatools pydot statsmodels fisher

which outputs:

Collecting goatools
  Could not find a version that satisfies the requirement goatools (from versions: )
No matching distribution found for goatools
(bioinfo)

I'd be grateful for some help, Thanks!

sequencing python alignment

Your activate is probably not activating a conda environment. Use which activate to find if it actually is a conda executable.

I'm not sure I follow, but here is what I get ...

$ which activate
(bioinfo)

That doesn't make sense. What is the output of conda env list?

$ conda env list
# conda environments:
#
base                     /Users/michaelflower/miniconda3

(bioinfo)

Please use the formatting bar (especially the code option) to present your post better. You can use backticks for inline code (`text` becomes text), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.
code_formatting

Thanks, the first worked well, but sed -i 's|/Users/michaelflower/miniconda3/envs/bioinfo||' ~/.conda/environments.txt produces sed: 1: "/Users/michaelflower/.c ...": invalid command code m (bioinfo)

Having said that, after removing the (?) damaged conda environment with your command rm -rf /Users/michaelflower/miniconda3/envs/bioinfo, I tried recreating the conda environment with conda create -y --name bioinfo python=3.6, and looks like it's all working. I've managed to run all the following commands to install pygraphviz.

source activate bioinfo

conda install pygraphviz

pip install goatools pydot statsmodels fisher

Thanks again!

Glad it worked. I'll move my comment to an answer, which you can accept.

I don't think you have. If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one answer if they all work.

Upvote|Bookmark|Accept

Nope. You should see the green check mark under my answer.

OK, looks like there's some communication gap. Please follow these steps:

  1. Right click on this link and open it in a new tab: C: How to run pygraphviz on macOS in conda
  2. You should see a green check mark under the book icon to the left of the content. It's not the thumbs up, nor the book; it's the green check with a circle around it - the third and bottom-most icon (see the image below). Click that

Done now I believe ...

On 28 Aug 2019, at 16:00, RamRS on Biostar <mailer@biostars.org<a rel="nofollow" href="mailto:mailer@biostars.org">mailer@biostars.org> wrote:

Activity on a post you are following on Biostarhttp://www.biostars.org

User RamRSRamRS wrote Comment: How to run pygraphviz on macOS in condaC: How to run pygraphviz on macOS in conda:

OK, looks like there's some communication gap. Please follow these steps:

  1. Right click on this link and open it in a new tab: C: How to run pygraphviz on macOS in condaC: How to run pygraphviz on macOS in conda
  2. You should see a green check mark under the book icon to the left of the content. It's not the thumbs up, nor the book; it's the green check with a circle around it - the third and bottom-most icon (see the image below). Click that

[https://image.ibb.co/dfsqrx/upvote_accept_bookmark.png]

1 answer

You do not have a conda environment named bioinfo. Your activate is activating something else, probably a virtualenv. Try running:

conda create -n bioinfo
source /Users/michaelflower/miniconda3/bin/activate bioinfo
conda install pygraphviz

Thanks RamRS. I’m still having problems, though the site restricted the number of posts I could make until now.

conda create -n bioinfo produces: WARNING: A directory already exists at the target location '/Users/michaelflower/miniconda3/envs/bioinfo' but it is not a conda environment. Continue creating environment (y/[n])? y CondaValueError: prefix already exists: /Users/michaelflower/miniconda3/envs/bioinfo (bioinfo)

source /Users/michaelflower/miniconda3/bin/activate bioinfo seems to be accepted ok: $ source /Users/michaelflower/miniconda3/bin/activate bioinfo (bioinfo)

conda install pygraphviz I get: DirectoryNotACondaEnvironmentError: The target directory exists, but it is not a conda environment. Use 'conda create' to convert the directory to a conda environment. target directory: /Users/michaelflower/miniconda3/envs/bioinfo

Thanks for our continued help, and apologies if this is basic

OK, something weird is going on. Maybe the environment creation did not run to completion.

Run

rm -rf /Users/michaelflower/miniconda3/envs/bioinfo
sed -i 's|/Users/michaelflower/miniconda3/envs/bioinfo||' ~/.conda/environments.txt
sed -i '/^$/d' ~/.conda/environments.txt

and then run the 3 commands from earlier. Please don't run subsequent commands if any command fails.

Log in to answer this question.