Error to run PF2

1,110 views
Skip to first unread message

Juan Esteban Uribe Arboleda

unread,
Jan 4, 2017, 6:32:03 PM1/4/17
to PartitionFinder
Dear Rob,

I am trying to run the PF2 in mac with the indications of the manual, but I have problems even to run the default example!
____________________________________________________________________________________________________________________

MacBook-Pro-de-juan:~ JuanEs$ Python /Users/JuanEs/Desktop/Pleurotomarioidea/Matrices/partitionfinder-2.1.1/PartitionFinder.py /Users/JuanEs/Desktop/Pleurotomarioidea/Matrices/partitionfinder-2.1.1/examples/nucleotide/partition_finder.cfg 

Traceback (most recent call last):

  File "/Users/JuanEs/Desktop/Pleurotomarioidea/Matrices/partitionfinder-2.1.1/PartitionFinder.py", line 21, in <module>

    from partfinder import main

  File "/Users/JuanEs/Desktop/Pleurotomarioidea/Matrices/partitionfinder-2.1.1/partfinder/main.py", line 23, in <module>

    import logtools

ImportError: No module named 'log tools'

___________________________________________________________________________________________________________________

What could I do?


all the best


Juanes

Paul Frandsen

unread,
Jan 4, 2017, 6:47:18 PM1/4/17
to PartitionFinder
Hi Juan,

Did you install the Anaconda distribution before running PF2? If so, it might be as simple as closing your terminal window and opening it up again.

If that doesn't work, what does your prompt say when you type "python"?

Paul

--
You received this message because you are subscribed to the Google Groups "PartitionFinder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to partitionfind...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

composed on my phone, apologies for any typos

Rob Lanfear

unread,
Jan 4, 2017, 7:17:44 PM1/4/17
to PartitionFinder

Hi Juanes,

I think Paul has hit the nail on the head. In case he's right, here's an explanation which should get you up and running.

It looks from this (though it’s very hard for you to know that from the output, which I’ll work on) that you’re using Python 3.x not Python 2.7.x.

Things to do:

  1. Check with version of Python you get when you just type ‘python’ at the commandline like this:
python --version
  1. You should get something that says Python 2.7.something, like this
aquila:~ roblanfear$ python --version
Python 2.7.12 :: Anaconda custom (x86_64)
  1. If you do, then I’m wrong about the problem, so post and let me know.

  2. If you get something else, perhaps like this:

(snakes) aquila:~ roblanfear$ python --version
 Python 3.5.2 :: Continuum Analytics, Inc.

then you are using the wrong version of Python. This can happen even if you followed the setup instructions, if you have previously installed Python 3.x and have your system set up to default to that.

The simplest fix here is to just set up a Python environment for Python 2, and run PartitionFinder from that environment. Here’s how to do that (details here: http://conda.pydata.org/docs/using/envs.html):

# create a python 2 environment
conda create --name python2 python=2 

# activate that environment
source activate python2

# the new environment won't have the dependencies you need, but installing them once is all you need. Just say 'yes' to installing them when prompted
conda install numpy pandas pytables pyparsing scipy scikit-learn

# now check that you get python 2.7.x when you type Python
python --version

As long as you get output that says ‘python 2.7.something’ in the last step, you can then run PartitionFinder2 from that environment, with your commandline as before:

Python /Users/JuanEs/Desktop/Pleurotomarioidea/Matrices/partitionfinder-2.1.1/PartitionFinder.py /Users/JuanEs/Desktop/Pleurotomarioidea/Matrices/partitionfinder-2.1.1/examples/nucleotide/partition_finder.cfg

Once your analysis is done, you can get out of that environment by typing

source deactivate

or just closing your terminal window.

To keep using the setup like this, you just type

source activate python2

before running your PF2 analyses in future. This will load the environment you need, with all the packages you already installed. I.e. once you activate the environment, you can just go ahead an run PF2.

Please let me know if this works - if it does, I’ll add a more useful error message to PF2 to this effect.

Cheers,

Rob


--
You received this message because you are subscribed to the Google Groups "PartitionFinder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to partitionfinder+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Rob Lanfear
Ecology, Evolution, and Genetics,
The Australian National University,
Canberra

Christopher Smith

unread,
Jan 27, 2018, 4:36:23 PM1/27/18
to PartitionFinder
Hey Guys,

Followed robs instructions about creating an environment for Python 2. Now when I execute partitionfinder it says it is missing the numpy dependency:

(python2) MacBook-Pro-18:~ chrissmith$ python /Applications/partitionfinder-2.1.1/PartitionFinder.py /Applications/partitionfinder-2.1.1/examples/nucleotide 




 **** ERROR **** 


Could not find the dependency numpy, please check that you have followed the installation instructions in the manual  and try again.


PartitionFinder 2 (unlike PartitionFinder 1) requires a few other Python packages to work. All of these can be installed very easily, in a single click, by installing the Python 2.7.x version of the Anaconda Python distrubition, which you can find here (remember to get the 2.7 version!): 


https://www.continuum.io/downloads 


Further instructions are in the installation section of the manual, which points out a number of other differences between PartitionFinder 1 and PartitionFinder 2 too.


 *************** 




Traceback (most recent call last):

  File "/Applications/partitionfinder-2.1.1/PartitionFinder.py", line 20, in <module>

    from partfinder import dependencies

  File "/Applications/partitionfinder-2.1.1/partfinder/dependencies.py", line 43, in <module>

    raise ImportError

ImportError

(python2) MacBook-Pro-18:~ chrissmith$ conda create --name python2 python=2.7


CondaValueError: prefix already exists: /anaconda3/envs/python2


(python2) MacBook-Pro-18:~ chrissmith$ python --version

Python 2.7.14 :: Anaconda, Inc.

(python2) MacBook-Pro-18:~ chrissmith$

To unsubscribe from this group and stop receiving emails from it, send an email to partitionfind...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Rob Lanfear

unread,
Jan 28, 2018, 5:46:20 PM1/28/18
to PartitionFinder
Hi Christopher,

If your installation of Python is missing the dependencies, you just need to install them from the command line like this:

conda install numpy pandas pytables pyparsing scipy scikit-learn

Cheers,

Rob
To unsubscribe from this group and stop receiving emails from it, send an email to partitionfinder+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Rob Lanfear
Division of Ecology and Evolution,
Research School of Biology,
Reply all
Reply to author
Forward
0 new messages