Need help installing Biopython - python-2.7

Have mac OS 10.6 and have python verion 2.7 32 bit intalled as
well as numpy and scipy.
also have xcode version 3.2, Im really confused as to what to do at this point. I download
biopython version 1.59 and tried to run the setup code in python but it wont work. what am i missing?
when i try and run the setup file in idle i get this error message:
Traceback (most recent call last):
File "/Users/Cliff/Downloads/biopython-1.58/setup.py", line 379, in <module>
'Bio.PopGen': ['SimCoal/data/*.par'],
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 140, in setup
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied

You need to run python setup.py install from Terminal.app. You should be in a bash, tcsh, etc. shell, not in a Python shell.

Just as an probably easier alternative:
Biopython is also available via pip:
pip install biopython
Or (even better) via bioconda (try it out, it's great):
conda install biopython
For this just install miniconda (very easy and does NOT require admin rights) from here. and then add the bioconda channel as per these simple instructions.
Strangly these two simple options are missing in the biopython tutorial

The error shows that you did not supply a command to the install script. The usual command is 'install', so try:
python setup.py install
In any event, as the error suggests, you can use:
python setup.py --help

Related

How can I install Pyomo's "extras" using pip?

I am writing because I am having trouble installing Pyomo using pip on Python 3.6 on Mac OSX 10.14
I'm following the installation instructions here.
I can successfully execute the first command:
pip install pyomo
But when I run into trouble when I'm supposed to run the following command to install additional dependencies:
pyomo install-extras
Running this command produces the following error:
Traceback (most recent call last):
File "/usr/local/bin/pyomo", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/pyomo/scripting/pyomo_main.py", line 82, in main
retval = _options.func(_options)
File "/usr/local/lib/python3.6/site-packages/pyomo/scripting/driver_help.py", line 46, in install_extras_exec
pyutilib.subprocess.run(command, tee=True)
File "/usr/local/lib/python3.6/site-packages/pyutilib/subprocess/processmngr.py", line 690, in run_command
th.join()
UnboundLocalError: local variable 'th' referenced before assignment
There is a post about this here on Google Groups but no solution yet.
This is a documented issue on the github for Pyomo: https://github.com/Pyomo/pyomo/issues/243
They don't appear to have solved the pip installation of pyomo extras.
However, if you have conda installed - https://docs.conda.io/en/latest/
You should be able to use the terminal commands from:
https://pyomo.readthedocs.io/en/latest/installation.html
run this in terminal after conda has been successfully installed:
conda install -c conda-forge pyomo.extras
I know this isn't pip, but it's at least a workaround until pyomo fixes their documentation.
confirmed working on python 3.x and ubuntu 18.04
I got the problem too (in Ubuntu 18.04).
Try installing it from the git project (https://github.com/Pyomo/pyomo):
In Ubuntu 18.04:
git clone https://github.com/Pyomo/pyomo.git
python3 pyomo/scripts/get_pyomo_extras.py
Use the corresponding commands for Mac OSX (I had never used it).
I hope that it works for you.

Can't install scimath in Python 2.7 to custom directory

I'm trying to install scimath 4.1.2 with pip 2.7.14 to a custom directory. There are two dependencies, that I have installed in a higher version than probably needed (but it's impossible to downgrade those):
numpy==1.9.3
matplotlib==2.0.2
Now, I'm getting the following error when trying to install scimath:
Processing /backup/pip/packages/scimath-4.1.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-req-build-QUsQtn/setup.py", line 9, in
import numpy.distutils.core
ImportError: No module named numpy.distutils.core
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-QUsQtn/
I'm not sure how I can solve this problem.
The solution was quite simple and embarrassing: I forgot to export PYTHONPATH before running pip. With that variable, it was working.

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-dxjZrU/pyproj/ when installing 'geopandas'

Before going to the topic, my computer information:
OS: Debian jessie, Python version: 2.7
I need to install the module "geopandas" for a project i am working on. The problem is that when i tried, i receive the following error:
root#debian:~# pip install geopandas
Collecting geopandas
Using cached https://files.pythonhosted.org/packages/0a/0e/8ae74743ed7915ddb7d70cc8dfa8fc0b9b9cc81205c6e288a01915a46192/geopandas-0.3.0-py2.py3-none-any.whl
Collecting pyproj (from geopandas)
Using cached https://files.pythonhosted.org/packages/29/72/5c1888c4948a0c7b736d10e0f0f69966e7c0874a660222ed0a2c2c6daa9f/pyproj-1.9.5.1.tar.gz
Complete output from command python setup.py egg_info:
unable to execute 'i586-linux-gnu-gcc': No such file or directory
using bundled proj4..
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-dxjZrU/pyproj/setup.py", line 72, in <module>
objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
File "/usr/lib/python2.7/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/usr/lib/python2.7/distutils/unixccompiler.py", line 122, in _compile
raise CompileError, msg
distutils.errors.CompileError: command 'i586-linux-gnu-gcc' failed with exit status 1
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-dxjZrU/pyproj/
I also looked other questions in this website about similiar problems, most of people recommend to update the setuptools, i have done that and still doesn't work, here the prove:
root#debian:~# pip install --upgrade setuptools
Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/dist-packages (39.2.0)
If anyone could help me with that i will be really happy
Thanks
Debian 8 Jessie, 32bit
'i586-linux-gnu-gcc': No such file or directory
# apt install g++ gfortran python-all-dev python-numpy libgdal-dev libgeos-dev python-matplotlib
# pip install geopandas
.
.
Running setup.py install for munch
Successfully installed geopandas shapely pandas fiona descartes pyproj python-dateutil numpy cligj click-plugins munch enum34 click
Cleaning up...

PyMC installation error with pip

I am attempting to install PyMC using pip install pymc. I believe this command should install PyMC 2.3.6.
PyMC has a few dependencies, which I have in my PATH. I am running OSX 10.11.2 and my PATH includes Python 2.7.13, NumPy 1.12.0, Matplotlib 2.0.0, gcc, and gfortran.
Python (including pip) was installed using Homebrew. NumPy and Matplotlib were installed using pip. The gfortran compiler was downloaded and installed from the GCC Wiki for the purpose of this installation.
Executing pip install pymc yielded lots of output including the following lines.
Collecting pymc
Using cached pymc-2.3.6.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
running build_src
build_src
building extension "pymc.flib" sources
f2py options: ['skip:ppnd7']
f2py:> build/src.macosx-10.11-x86_64-2.7/pymc/flibmodule.c
creating build
creating build/src.macosx-10.11-x86_64-2.7
creating build/src.macosx-10.11-x86_64-2.7/pymc
IOError: [Errno 2] No such file or directory: 'skip:ppnd7'. Skipping file "skip:ppnd7".
updatevars:gradlike: attempt to change 'dimension(nx)' to 'dimension(na)'. Ignoring.
updatevars:gradlike: attempt to change 'dimension(nx)' to 'dimension(nb)'. Ignoring.
updatevars:gradlike: attempt to change 'dimension (nmu)' to 'dimension(nmu)'. Ignoring.
updatevars:gradlike: attempt to change 'dimension (na)' to 'dimension(na)'. Ignoring.
rmbadname1: Replacing "index" with "index_bn".
Reading fortran codes...
Reading file 'pymc/flib.f' (format:fix,strict)
Line #34 in pymc/flib.f:" PARAMETER (infinity = 1.7976931348623157d308)"
get_parameters: got "unexpected EOF while parsing (<string>, line 0)" on ''
...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/2f/cr97n5v93mn04c3qbqd7r3q40000gn/T/pip-build-6Zmgcz/pymc/setup.py", line 124, in <module>
**(config_dict))
File "/usr/local/lib/python2.7/site-packages/numpy/distutils/core.py", line 169, in setup
return old_setup(**new_attr)
...
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/2f/cr97n5v93mn04c3qbqd7r3q40000gn/T/pip-build-6Zmgcz/pymc/
As suggested in these two pip installation threads about egg_info errors [1, 2], I ran pip install —upgrade setuptools and pip install ez_setup. Once these items were installed I ran into the same types of errors pasted above.
As noted in other package installation threads, I am willing to use conda to install PyMC if I cannot resolve these issues. However, I'd like to investigate this installation issue first.
Would anyone happen to know what my issue is here? Might there be some steps I can take to successfully install PyMC using pip?
I had the same problem. I don't understand the root cause, but I fixed it by downgrading numpy to version 1.10.1: pip install numpy==1.10.1
I also met this problem while trying to install pymc from pip or source code, but I found a solution that might be useful.
The reason that causes the problem might be the file setup.py, in which the script check the compile env. I didn't read the code very carefully, but in the function build_ext() I think the codes first check whether some compile environments have already been installed into OS. If installed, the script will use them as defaults; if not, use ones in somewhere else (the comment says 'from netlib sources').
I infer the problem is caused by the compile environments that have already been installed in the OS, so I modify the file setup.py to skip this part of codes, and let the script use the netlib source. Then I run sudo python setup.py install. There are some error and warning messages, but the folder 'pymc' emerges in python library, and some simple test codes run successfully.

How to install and run the reindent.py

I have downloaded the Reindent-0.1.0 and trying to use this for automated indention purpose.
I don't know how to install and run these commands and while I am trying to use this command
I am getting following error
command:
C:\Python26\Scripts\Reindent-0.1.0>Python setup.py
C:\Python26\Scripts\Reindent-0.1.0>Pyth
Traceback (most recent call last):
File "setup.py", line 5, in <module>
from setuptools import setup
ImportError: No module named setuptools
I don't understand the setuptools, where it is and how to put inside
please note my folder files in Reindent-0.1.0
Reindent.egg-info
PKG-INFO
README
reindent
setup.cfg
setup.py
Also how can I run the commands for reindent, for an example, once after I installed the reindent, if I want to
run dryrun command how I should write?
If I write like this, will it be correct ???
C:\ProjFolder\ApplicationDevelopment\GUI>reindent -d Test.py
some realtime example of "-d (--dryrun) Dry run and -r (--recurse) Recurse" will be helpful!!
and where I should target the command file path, in dos
to my application running directory or C:\Python26\Scripts\Reindent-0.1.0 ?? OR Application development folder??
If you get the error "no module X" when you try to run some code, that code has a dependency on module X. When you run setup.py and it says there is no module named "setuptools", it is telling you that setup.py requires the module "setuptools". Since you don't have "setuptools" installed on your machine, you get the error.
The fix is simple: install the setuptools module. Here's one of several places on the internet that shows you how to install setuptools: https://pythonhosted.org/an_example_pypi_project/setuptools.html