How to run pygraphviz on macOS in conda
1
0
Entering edit mode
5.3 years ago

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 • 3.4k views
ADD COMMENT
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

$ which activate
(bioinfo)
ADD REPLY
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode
$ conda env list
# conda environments:
#
base                     /Users/michaelflower/miniconda3

(bioinfo)
ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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)

ADD REPLY
0
Entering edit mode

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!

ADD REPLY
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Thanks, I've done that

ADD REPLY
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Think it's done now ...

ADD REPLY
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

I’ve unticked all your comments now ...

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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]

ADD REPLY
2
Entering edit mode
5.3 years ago
Ram 44k

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
ADD COMMENT
1
Entering edit mode

I want to mention here that conda activation works differently starting with conda 4.6

https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

they have removed the source activate approach and replaced it with conda activate

For the original poster I would recommend removing the entire miniconda3 directory and starting from scratch with the latest conda.

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 2510 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6