Question: How to run pygraphviz on macOS in conda
0
gravatar for michael.flower.14
4 months ago by
United Kingdom
michael.flower.140 wrote:

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 alignment python • 357 views
ADD COMMENTlink modified 4 months ago • written 4 months ago by michael.flower.140
1

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

ADD REPLYlink written 4 months ago by RamRS25k

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

$ which activate
(bioinfo)
ADD REPLYlink modified 4 months ago by RamRS25k • written 4 months ago by michael.flower.140
1

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

ADD REPLYlink written 4 months ago by RamRS25k
$ conda env list
# conda environments:
#
base                     /Users/michaelflower/miniconda3

(bioinfo)
ADD REPLYlink modified 4 months ago by RamRS25k • written 4 months ago by michael.flower.140

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 REPLYlink written 4 months ago by RamRS25k

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 REPLYlink written 4 months ago by michael.flower.140

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 REPLYlink modified 4 months ago • written 4 months ago by michael.flower.140
1

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

ADD REPLYlink written 4 months ago by RamRS25k

Thanks, I've done that

ADD REPLYlink written 4 months ago by michael.flower.140
1

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 REPLYlink written 4 months ago by RamRS25k

Think it's done now ...

ADD REPLYlink written 4 months ago by michael.flower.140
1

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

ADD REPLYlink written 4 months ago by RamRS25k

I’ve unticked all your comments now ...

ADD REPLYlink written 4 months ago by michael.flower.140

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 REPLYlink written 4 months ago by RamRS25k

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 REPLYlink written 4 months ago by michael.flower.140
2
gravatar for RamRS
4 months ago by
RamRS25k
Houston, TX
RamRS25k wrote:

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 COMMENTlink written 4 months ago by RamRS25k
1

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 REPLYlink written 4 months ago by Istvan Albert ♦♦ 82k

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 REPLYlink written 4 months ago by michael.flower.140
1

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 REPLYlink modified 4 months ago • written 4 months ago by RamRS25k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1144 users visited in the last hour