473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

OpenOpt install

What do I need to do? I have numpy, scipy (Fedora F8)

cd openopt/
[nbecker@nbecker1 openopt]$ python setup.py build
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_py
creating build
creating build/lib
creating build/lib/scikits
copying scikits/__init__.py -build/lib/scikits
creating build/lib/scikits/openopt
copying scikits/openopt/__init__.py -build/lib/scikits/openopt
copying scikits/openopt/info.py -build/lib/scikits/openopt
copying scikits/openopt/oo.py -build/lib/scikits/openopt
Traceback (most recent call last):
File "setup.py", line 101, in <module>
import scikits
ImportError: No module named scikits

Dec 16 '07 #1
5 2832
Use
python setup.py install

Regards, D

On Dec 16, 2:27 pm, Neal Becker <ndbeck...@gmail.comwrote:
What do I need to do? I have numpy, scipy (Fedora F8)

cdopenopt/
[nbecker@nbecker1openopt]$ python setup.py build
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_py
creating build
creating build/lib
creating build/lib/scikits
copying scikits/__init__.py -build/lib/scikits
creating build/lib/scikits/openopt
copying scikits/openopt/__init__.py -build/lib/scikits/openopt
copying scikits/openopt/info.py -build/lib/scikits/openopt
copying scikits/openopt/oo.py -build/lib/scikits/openopt
Traceback (most recent call last):
File "setup.py", line 101, in <module>
import scikits
ImportError: No module named scikits
Dec 17 '07 #2
dmitrey wrote:
Use
python setup.py install
People should be able to run the distutils commands independently.

What are you trying to achieve with this block of code that follows the setup()
call?

new_name = 'tmp55'
os.rename('scikits', new_name)
newPath = []
for directory in sys.path:
if not 'scikits' in directory: newPath.append(directory)# something
wrong with list.remove()
sys.path = newPath
import scikits
reload(scikits)
Path = scikits.__path__[0]
NewPath = os.path.join(Path, 'openopt')
rmtree(NewPath, True) # True means ignore errors
copytree(os.path.join(os.path.curdir, new_name, 'openopt'), NewPath)
NewPath = Path
compileall.compile_dir(NewPath)

os.rename(new_name, 'scikits')
This just looks like a really bad idea.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Dec 17 '07 #3
When earlier OpenOpt versions had been installed there were no
compiled pyc-files (in destination directory). I called to mailing
list but no obvious receipt had been achieved. Matthieu had done some
changes but it yielded other mistakes (no some py-files detected or
kind of), so I had removed those changes and write my own, for to have
OO py-files being compiled when installed, because next time when they
will be run user may not have root permissions, so he will recompile
source files each time OO starts.

On Dec 17, 10:27 pm, Robert Kern <robert.k...@gmail.comwrote:
dmitrey wrote:
Use
python setup.py install

People should be able to run the distutils commands independently.

What are you trying to achieve with this block of code that follows the setup()
call?

new_name = 'tmp55'
os.rename('scikits', new_name)
newPath = []
for directory in sys.path:
if not 'scikits' in directory: newPath.append(directory)# something
wrong with list.remove()
sys.path = newPath
import scikits
reload(scikits)
Path = scikits.__path__[0]
NewPath = os.path.join(Path, 'openopt')
rmtree(NewPath, True) # True means ignore errors
copytree(os.path.join(os.path.curdir, new_name, 'openopt'), NewPath)
NewPath = Path
compileall.compile_dir(NewPath)

os.rename(new_name, 'scikits')

This just looks like a really bad idea.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
Dec 18 '07 #4
dmitrey wrote:
When earlier OpenOpt versions had been installed there were no
compiled pyc-files (in destination directory). I called to mailing
list but no obvious receipt had been achieved. Matthieu had done some
changes but it yielded other mistakes (no some py-files detected or
kind of), so I had removed those changes and write my own, for to have
OO py-files being compiled when installed, because next time when they
will be run user may not have root permissions, so he will recompile
source files each time OO starts.
Well, the problem there is that you have put code into subdirectories that
aren't packages. Then you manually add the directories to sys.path when you
import scikits.openopt.oo . This is a bad thing to do for several reasons; one
reason is that you don't get the correct .pyc files.

You need to make the directory structure match the package structure. For
example, you currently have the module scikits.openopt.LP in
scikits/openopt/Kernel/LP/LP.py . You have two options:

* you can make the directory structure match the package structure by moving
the files to the correct location:

$ mv scikits/openopt/Kernel/LP/LP.py scikits/openopt/LP.py

* you can make the package structure match the directory structure by adding
__init__.py files to the subdirectories and changing the imports to match:

$ touch scikits/openopt/Kernel/__init__.py
$ touch scikits/openopt/Kernel/LP/__init__.py
$ vim scikits/openopt/oo.py
# 1. Delete the sys.path munging.
# 2. Change "from LP import LP as CLP" to "from Kernel.LP import LP as CLP"

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Dec 18 '07 #5
thank you, I'll try to fix the issue when I'll have more time, I'm
short of the one for now because of some other urgent work.
D.

On Dec 18, 10:53 am, Robert Kern <robert.k...@gmail.comwrote:
dmitrey wrote:
When earlier OpenOpt versions had been installed there were no
compiled pyc-files (in destination directory). I called to mailing
list but no obvious receipt had been achieved. Matthieu had done some
changes but it yielded other mistakes (no some py-files detected or
kind of), so I had removed those changes and write my own, for to have
OO py-files being compiled when installed, because next time when they
will be run user may not have root permissions, so he will recompile
source files each time OO starts.

Well, the problem there is that you have put code into subdirectories that
aren't packages. Then you manually add the directories to sys.path when you
import scikits.openopt.oo . This is a bad thing to do for several reasons; one
reason is that you don't get the correct .pyc files.

You need to make the directory structure match the package structure. For
example, you currently have the module scikits.openopt.LP in
scikits/openopt/Kernel/LP/LP.py . You have two options:

* you can make the directory structure match the package structure by moving
the files to the correct location:

$ mv scikits/openopt/Kernel/LP/LP.py scikits/openopt/LP.py

* you can make the package structure match the directory structure by adding
__init__.py files to the subdirectories and changing the imports to match:

$ touch scikits/openopt/Kernel/__init__.py
$ touch scikits/openopt/Kernel/LP/__init__.py
$ vim scikits/openopt/oo.py
# 1. Delete the sys.path munging.
# 2. Change "from LP import LP as CLP" to "from Kernel.LP import LP as CLP"

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
Dec 18 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Yun Guan | last post by:
Hello mysql gurus, I am trying to run perl on mysql database on Red Hat box. I want to install DBI and DBD:mysql using CPAN: perl -MCPAN -e shell cpan>install DBI The above succeeded, but...
1
by: Peter Hartmann | last post by:
How do I influence the platform type during install? Could you look at this and tell me what I'm doing wrong? It's still using information from get_platform instead of using my preference. #...
3
by: Henry Reardon | last post by:
Can someone remind me how to re-install the Development Center? I was playing with the Environment Settings a bit the other day and, ever since, it hasn't worked right. I can create a new Project...
3
by: Jeremy S. | last post by:
On my dev machine (XP/Pro with VS.NET 2003) I have been developing a Windows Service and installing it on the local machine by opening the Visual Studio Command Prompt and then executing . Now I...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
5
by: Ajith Menon | last post by:
I have to install .NET framework 3.0. I already have .NET Framework 1.1 installed on my machine. I don't want to remove framework 1.1 since some of the critical applications are using it. While...
1
by: Sorin Schwimmer | last post by:
Hi All, After a disaster in which I lost my whole harddrive, I decided to install the newest everything that I use. I put the latest Gentoo Linux, with gcc 4.1.1, installed tcl/tk 8.4.14 and...
1
by: =?Utf-8?B?Qi5BaGxzdGVkdA==?= | last post by:
Hi all, This is something that I have been toying with for about a week now. What I want to achieve is Install a Service with Customised parameters (using InstallUtil.exe) for User Name. Example...
3
by: Jean-Marc Blaise | last post by:
Hi, I've been trying for 2 hours to install in silent mode a DB2 9 runtime client. Why didn't you make this process as simple as for the CLIENT install ? It is not the same setup command, you...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.