Pyomo Installation under Ubuntu 14.04 and Python 3.4

552 views
Skip to first unread message

Cord Kaldemeyer

unread,
May 11, 2015, 9:28:03 AM5/11/15
to pyomo...@googlegroups.com
I want to use Pyomo with Python 3.4 under Ubuntu 14.04 x64 and have tried to install it using pip3 with the following command:

sudo pip3 install pyomo

But this leads to the following error:

cord@cord-Latitude-E7440:~$ sudo pip3 install --upgrade pyomo
Cleaning up...
Exception:
Traceback (most recent call last):
 
File "/usr/lib/python3/dist-packages/pip/req.py", line 810, in check_if_exists
   
self.satisfied_by = pkg_resources.get_distribution(self.req)
 
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg/pkg_resources.py", line 350, in get_distribution
   
if isinstance(dist,Requirement): dist = get_provider(dist)
 
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg/pkg_resources.py", line 229, in get_provider
   
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
 
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg/pkg_resources.py", line 673, in require
    needed
= self.resolve(parse_requirements(requirements))
 
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg/pkg_resources.py", line 580, in resolve
   
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources
.VersionConflict: (PyUtilib 4.7.3340 (/usr/local/lib/python3.4/dist-packages), Requirement.parse('PyUtilib>=5.0'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status
= self.run(options, args)
 
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 278, in run
    requirement_set
.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
 
File "/usr/lib/python3/dist-packages/pip/req.py", line 1090, in prepare_files
    req_to_install
.check_if_exists()
 
File "/usr/lib/python3/dist-packages/pip/req.py", line 814, in check_if_exists
    existing_dist
= pkg_resources.get_distribution(self.req.project_name)
 
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg/pkg_resources.py", line 350, in get_distribution
   
if isinstance(dist,Requirement): dist = get_provider(dist)
 
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg/pkg_resources.py", line 229, in get_provider
   
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
 
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg/pkg_resources.py", line 673, in require
    needed
= self.resolve(parse_requirements(requirements))
 
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg/pkg_resources.py", line 580, in resolve
   
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources
.VersionConflict: (PyUtilib 4.7.3340 (/usr/local/lib/python3.4/dist-packages), Requirement.parse('PyUtilib>=5.0'))

Storing debug log for failure in /home/cord/.pip/pip.log


Can anyone help me with this?

Cheers
Cord

William Hart

unread,
May 11, 2015, 9:32:59 AM5/11/15
to pyomo...@googlegroups.com
I'm not familiar with pip3.  It looks like pip is having trouble reconciling different PyUtilib versions.  I'd try uninstalling PyUtilib 4.7 and then re-installing Pyomo.

--Bill

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

Cord Kaldemeyer

unread,
May 11, 2015, 9:58:35 AM5/11/15
to pyomo...@googlegroups.com
Hi Bill,

thanks for your quick reply! I have followed your suggestion and successfully installed Pyomo:

cord@cord-Latitude-E7440:~$ sudo pip3 install pyomo
Downloading/unpacking pyomo
 
Downloading Pyomo-4.0.9682-py3-none-any.whl (1.1MB): 1.1MB downloaded
Requirement already satisfied (use --upgrade to upgrade): six>=1.6.1 in /usr/local/lib/python3.4/dist-packages (from pyomo)
Requirement already satisfied (use --upgrade to upgrade): ply in /usr/local/lib/python3.4/dist-packages (from pyomo)
Requirement already satisfied (use --upgrade to upgrade): PyUtilib>=5.0 in /usr/local/lib/python3.4/dist-packages/PyUtilib-5.0.3478-py3.4.egg (from pyomo)
Requirement already satisfied (use --upgrade to upgrade): nose in ./.local/lib/python3.4/site-packages (from pyomo)
Installing collected packages: pyomo
Successfully installed pyomo
Cleaning up...

cord@cord
-Latitude-E7440:~$ sudo pip3 install --upgrade pyomo
Requirement already up-to-date: pyomo in /usr/local/lib/python3.4/dist-packages
Cleaning up...
cord@cord
-Latitude-E7440:~$


But if I now run a model (that worked under Python 2.7 with Pyomo 4.0) I get the following error which a a first glance is not related to my model.

>>> runfile('/home/cord/Programmierung/DLSK/Vereinfachtes_Kraftwerksmodell/mdl_power_plant_spot_tr_basic_plot_farbe.py', wdir='/home/cord/Programmierung/DLSK/Vereinfachtes_Kraftwerksmodell')

Traceback (most recent call last):

 
File "<stdin>", line 1, in <module>
 
File "/usr/local/lib/python3.4/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 682, in runfile
    execfile
(filename, namespace)
 
File "/usr/local/lib/python3.4/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 85, in execfile
   
exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
 
File "/home/cord/Programmierung/DLSK/Vereinfachtes_Kraftwerksmodell/mdl_power_plant_spot_tr_basic_plot_farbe.py", line 20, in <module>
   
from pyomo.environ import *
 
File "/usr/local/lib/python3.4/dist-packages/pyomo/environ/__init__.py", line 13, in <module>
   
import pyomo.core
 
File "/usr/local/lib/python3.4/dist-packages/pyomo/core/__init__.py", line 11, in <module>
   
PluginGlobals.add_env("pyomo")
AttributeError: type object 'PluginGlobals' has no attribute 'add_env'
>>>



 Any hints?

Cheers
Cord

Cord Kaldemeyer

unread,
May 11, 2015, 10:01:43 AM5/11/15
to pyomo...@googlegroups.com

Siirola, John D

unread,
May 11, 2015, 11:47:14 AM5/11/15
to pyomo...@googlegroups.com

PyUtilib 4.7 was the last of the “distributed” versions of pyutilib – where the components (pyutilib.dev, pyutilib.workflow, etc) were installed as separate Python modules.  By uninstalling PyUtilib 4.7, you only uninstalled the umbrella module that set the dependencies on all the sub-modules.  The submodules from 4.7 are still installed, and they are now fighting with PyUtilib 5.x.

 

The solution is to uninstall *all*pyutilib.* modules (and all coopr.* modules) and then to reinstall Pyomo 4.x and PyUtilib 5.x (pulled automatically by dependency resolution when installing Pyomo).  If you don’t want to do that uninstall manually, we provide a pyomo_uninstall.py script (https://software.sandia.gov/trac/pyomo/downloader/download/file/79) that will uninstall Pyomo 4.x, Coopr 3.x, PyUtilib 4.x and Pyutilib 5.x, and all the component modules.

 

john

--

Cord Kaldemeyer

unread,
May 16, 2015, 9:45:30 AM5/16/15
to pyomo...@googlegroups.com
You were right. Now everythin seems to work fine (except for some model adaptions). Thanks!

Cord
...

Cord Kaldemeyer

unread,
May 19, 2015, 3:46:11 AM5/19/15
to pyomo...@googlegroups.com
Sorry, I was a bit too hasty with my answer.

If I now run a model I get an error "Error loading 'pyutilib.component' entry points: 'pyutilib.misc'".

Any ideas?

Cheers
Cord

Cord Kaldemeyer

unread,
May 22, 2015, 8:14:30 AM5/22/15
to pyomo...@googlegroups.com
I could now fix the error on my own. Apparently, some old pip3-installed coopr packages were installed beside the newest pyomo-version. Since a regular "pip3 uninstall" did not work properly, I have removed them as described in the following link (http://askubuntu.com/questions/173323/how-do-i-detect-and-remove-python-packages-installed-via-pip) and then reinstalled Pyomo via pip3. Now everything works fine and also without "pyutilib" as "pip3 freeze" does not list this package anymore.

Thanks anyway!

respect sosa

unread,
Jan 28, 2016, 11:05:26 AM1/28/16
to Pyomo Forum

I am trying to install Pyomo but i am getting the following errors. Can somebody help


''Downloading/unpacking pip
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement pip
Cleaning up...
No distributions at all found for pip
Storing debug log for failure in /home/sosa/.pip/pip.log
ERROR: Problem installing pip.  No pip executable found after installing pip in /tmp/tmpUSiCCk
sosa@sosa-Aspire-E5-571:~/Downloads$ sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree      
Reading state information... Done
python3-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.
sosa@sosa-Aspire-E5-571:~/Downloads$ sudo pip3 install pyomo
Downloading/unpacking pyomo
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement pyomo
Cleaning up...
No distributions at all found for pyomo
Storing debug log for failure in /home/sosa/.pip/pip.log
sosa@sosa-Aspire-E5-571:~/Downloads$ ""

Siirola, John D

unread,
Jan 28, 2016, 1:37:49 PM1/28/16
to pyomo...@googlegroups.com

It looks like you have a network connectivity issue.  Are you sitting behind a proxy server?   Worst case, you can grab the ZIP files that we publish and use pyomo_install to perform an offline installation.  See the Installation Guide for more detail on this.

 

john

--

Reply all
Reply to author
Forward
0 new messages