Installing to WinPython 3.6.0

270 views
Skip to first unread message

Robbie Urwin

unread,
Sep 28, 2017, 5:04:50 PM9/28/17
to or-tools-discuss
Hi,

I've been trying to install or-tools for several hours, with no success! I am trying to install to WinPython 3.6.0.1 and have been using the 'Developer Command Prompt for VS2017'.

I have tried the following actions:

1. Download the Python Zip on the installation guide and unzipped it
2. Ran Developer Command Prompt for VS2017 and cd'd to where I unzipped
3. python setup.py install

Seems to work OK, as below:

running install
running bdist_egg
running egg_info
writing ortools_examples.egg-info\PKG-INFO
writing dependency_links to ortools_examples.egg-info\dependency_links.txt
writing requirements to ortools_examples.egg-info\requires.txt
writing top-level names to ortools_examples.egg-info\top_level.txt
reading manifest file 'ortools_examples.egg-info\SOURCES.txt'
writing manifest file 'ortools_examples.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
warning: install_lib: 'build\lib' does not exist -- no Python modules to install

creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\EGG-INFO
copying ortools_examples.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying ortools_examples.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying ortools_examples.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying ortools_examples.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying ortools_examples.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist\ortools_examples-6.4.4495-py3.6.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing ortools_examples-6.4.4495-py3.6.egg
Copying ortools_examples-6.4.4495-py3.6.egg to c:\users\robbie\winpython-64bit-3.6.0.1qt5\python-3.6.0.amd64\lib\site-packages
Adding ortools-examples 6.4.4495 to easy-install.pth file

Installed c:\users\robbie\winpython-64bit-3.6.0.1qt5\python-3.6.0.amd64\lib\site-packages\ortools_examples-6.4.4495-py3.6.egg
Processing dependencies for ortools-examples==6.4.4495
Searching for py3-ortools==6.4.4495
Best match: py3-ortools 6.4.4495
Processing py3_ortools-6.4.4495-py3.6-win-amd64.egg
Adding py3-ortools 6.4.4495 to easy-install.pth file

Using c:\users\robbie\appdata\roaming\python\python36\site-packages\py3_ortools-6.4.4495-py3.6-win-amd64.egg
Searching for protobuf==3.2.0
Best match: protobuf 3.2.0
Processing protobuf-3.2.0-py3.6.egg
Adding protobuf 3.2.0 to easy-install.pth file

Using c:\users\robbie\appdata\roaming\python\python36\site-packages\protobuf-3.2.0-py3.6.egg
Searching for setuptools==36.5.0
Best match: setuptools 36.5.0
Adding setuptools 36.5.0 to easy-install.pth file
Installing easy_install-script.py script to C:\Users\Robbie\WinPython-64bit-3.6.0.1Qt5\python-3.6.0.amd64\Scripts
Installing easy_install.exe script to C:\Users\Robbie\WinPython-64bit-3.6.0.1Qt5\python-3.6.0.amd64\Scripts
Installing easy_install-3.6-script.py script to C:\Users\Robbie\WinPython-64bit-3.6.0.1Qt5\python-3.6.0.amd64\Scripts
Installing easy_install-3.6.exe script to C:\Users\Robbie\WinPython-64bit-3.6.0.1Qt5\python-3.6.0.amd64\Scripts

Using c:\users\robbie\winpython-64bit-3.6.0.1qt5\python-3.6.0.amd64\lib\site-packages
Searching for six==1.10.0
Best match: six 1.10.0
Adding six 1.10.0 to easy-install.pth file

Using c:\users\robbie\winpython-64bit-3.6.0.1qt5\python-3.6.0.amd64\lib\site-packages
Finished processing dependencies for ortools-examples==6.4.4495

4. Create the my_program.py example and try and run

I get the following error:

Traceback (most recent call last):
  File "C:\Users\Robbie\AppData\Roaming\Python\Python36\site-packages\py3_ortools-6.4.4495-py3.6-win-amd64.egg\ortools\linear_solver\pywraplp.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\Users\Robbie\WinPython-64bit-3.6.0.1Qt5\python-3.6.0.amd64\Lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 648, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 560, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 922, in create_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "my_program.py", line 2, in <module>
    from ortools.linear_solver import pywraplp
  File "C:\Users\Robbie\AppData\Roaming\Python\Python36\site-packages\py3_ortools-6.4.4495-py3.6-win-amd64.egg\ortools\linear_solver\pywraplp.py", line 17, in <module>
    _pywraplp = swig_import_helper()
  File "C:\Users\Robbie\AppData\Roaming\Python\Python36\site-packages\py3_ortools-6.4.4495-py3.6-win-amd64.egg\ortools\linear_solver\pywraplp.py", line 16, in swig_import_helper
    return importlib.import_module('_pywraplp')
  File "C:\Users\Robbie\WinPython-64bit-3.6.0.1Qt5\python-3.6.0.amd64\Lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_pywraplp'

Any help at all much appreciated.

Laurent Perron

unread,
Sep 29, 2017, 2:54:44 AM9/29/17
to or-tools-discuss
Can you try adding the dolls in the installed python modules to your path?

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

Robbie Urwin

unread,
Sep 29, 2017, 9:43:39 AM9/29/17
to or-tools-discuss
Thanks for the response. What do you mean by 'adding the dolls'? I've tried adding "C:\Users\Robbie\AppData\Roaming\Python\Python36\site-packages\" to my path with no success.

Also I'm confused as to why some of the eggs are put here:

c:\users\robbie\winpython-64bit-3.6.0.1qt5\python-3.6.0.amd64\lib\site-packages\ortools_examples-6.4.4495-py3.6.egg

and some are here:

c:\users\robbie\appdata\roaming\python\python36\site-packages\py3_ortools-6.4.4495-py3.6-win-amd64.egg

This seems like it might be part of the problem, I'd have thought it would install in the WinPython location rather than creating a new python36 directory in my appdata?

Yingjue

unread,
Sep 29, 2017, 1:07:53 PM9/29/17
to or-tools-discuss
Just want to report that though my computer has slightly different environment, I have followed the same installation procedure and encountered the same problem, and thus closely follow this post for solutions.

I tried on two machines, one is Win7 OS 64bit and another is Win10 OS 64 bit. Both installed VS2017 and Python 3.6.2 64 bit.
I installed Python for all users and the folder is "C:\Program Files\Python36".
I unzipped the ortools_examples at "C:\Program Files\Python36\Lib\site-packages\ortools_examples".

I am new to Python and do not understand the "adding the dolls" instruction neither. Thanks!

Laurent Perron

unread,
Sep 29, 2017, 1:11:29 PM9/29/17
to or-tools-discuss
dolls = dlls 


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

Robbie Urwin

unread,
Sep 29, 2017, 2:09:18 PM9/29/17
to or-tools-discuss
That makes more sense! As far as I can see the install isn't getting as far as installing any dll's. Any solution you can think of would be much appreciated.

Here is the output from my latest attempt to install:

----------------------------------------------------------------------------------------------------

running install
running bdist_egg
running egg_info
writing ortools_examples.egg-info\PKG-INFO
writing dependency_links to ortools_examples.egg-info\dependency_links.txt
writing requirements to ortools_examples.egg-info\requires.txt
writing top-level names to ortools_examples.egg-info\top_level.txt
reading manifest file 'ortools_examples.egg-info\SOURCES.txt'
writing manifest file 'ortools_examples.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
warning: install_lib: 'build\lib' does not exist -- no Python modules to install

creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\EGG-INFO
copying ortools_examples.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying ortools_examples.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying ortools_examples.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying ortools_examples.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying ortools_examples.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist\ortools_examples-6.4.4495-py3.6.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing ortools_examples-6.4.4495-py3.6.egg
Copying ortools_examples-6.4.4495-py3.6.egg to c:\users\robbie\appdata\roaming\python\python36\site-packages
Adding ortools-examples 6.4.4495 to easy-install.pth file

Installed c:\users\robbie\appdata\roaming\python\python36\site-packages\ortools_examples-6.4.4495-py3.6.egg
Processing dependencies for ortools-examples==6.4.4495
Searching for py3-ortools==6.4.4495
Best match: py3-ortools 6.4.4495
Processing py3_ortools-6.4.4495-py3.6-win-amd64.egg
creating c:\users\robbie\appdata\roaming\python\python36\site-packages\py3_ortools-6.4.4495-py3.6-win-amd64.egg
Extracting py3_ortools-6.4.4495-py3.6-win-amd64.egg to c:\users\robbie\appdata\roaming\python\python36\site-packages
Adding py3-ortools 6.4.4495 to easy-install.pth file

Installed c:\users\robbie\appdata\roaming\python\python36\site-packages\py3_ortools-6.4.4495-py3.6-win-amd64.egg
Searching for protobuf==3.2.0
Best match: protobuf 3.2.0
Processing protobuf-3.2.0.tar.gz
Writing C:\Users\Robbie\AppData\Local\Temp\easy_install-evm4k245\protobuf-3.2.0\setup.cfg
Running protobuf-3.2.0\setup.py -q bdist_egg --dist-dir C:\Users\Robbie\AppData\Local\Temp\easy_install-evm4k245\protobuf-3.2.0\egg-dist-tmp-g9yr3w2b
no previously-included directories found matching 'google\protobuf\internal\import_test_package'
warning: no previously-included files found matching 'google\protobuf\internal\*_pb2.py'
warning: no previously-included files found matching 'google\protobuf\internal\*_test.py'
warning: no previously-included files found matching 'google\protobuf\internal\*.proto'
warning: no previously-included files found matching 'google\protobuf\internal\test_util.py'
warning: no previously-included files matching '*_test.py' found under directory 'google'
warning: no previously-included files matching '*_test.proto' found under directory 'google'
warning: no previously-included files matching 'unittest*_pb2.py' found under directory 'google'
warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
zip_safe flag not set; analyzing archive contents...
google.__pycache__.__init__.cpython-36: module references __path__
google.protobuf.__pycache__.__init__.cpython-36: module references __path__
google.protobuf.pyext.__pycache__.__init__.cpython-36: module references __path__
creating c:\users\robbie\appdata\roaming\python\python36\site-packages\protobuf-3.2.0-py3.6.egg
Extracting protobuf-3.2.0-py3.6.egg to c:\users\robbie\appdata\roaming\python\python36\site-packages
Adding protobuf 3.2.0 to easy-install.pth file

Installed c:\users\robbie\appdata\roaming\python\python36\site-packages\protobuf-3.2.0-py3.6.egg
Searching for setuptools==36.5.0
Best match: setuptools 36.5.0
Adding setuptools 36.5.0 to easy-install.pth file
Installing easy_install-script.py script to C:\Users\Robbie\AppData\Roaming\Python\Python36\Scripts
Installing easy_install.exe script to C:\Users\Robbie\AppData\Roaming\Python\Python36\Scripts
Installing easy_install-3.6-script.py script to C:\Users\Robbie\AppData\Roaming\Python\Python36\Scripts
Installing easy_install-3.6.exe script to C:\Users\Robbie\AppData\Roaming\Python\Python36\Scripts

Using c:\users\robbie\winpython-64bit-3.6.0.1qt5\python-3.6.0.amd64\lib\site-packages
Searching for six==1.10.0
Best match: six 1.10.0
Adding six 1.10.0 to easy-install.pth file

Using c:\users\robbie\winpython-64bit-3.6.0.1qt5\python-3.6.0.amd64\lib\site-packages
Finished processing dependencies for ortools-examples==6.4.4495
[ERROR] You are using py3-ortools-(OR_TOOLS_VERSION) : C:\Users\Robbie\AppData\Roaming\Python\Python36\site-packages\py3_ortools-6.4.4495-py3.6-win-amd64.egg\ortools\__init__.py, while the required version is : 6.4.4495
Run "C:\Users\Robbie\WinPython-64bit-3.6.0.1Qt5\python-3.6.0.amd64\python.exe setup.py install --user" to upgrade.
If the problem persists, remove the site-package that contains "C:\Users\Robbie\AppData\Roaming\Python\Python36\site-packages\py3_ortools-6.4.4495-py3.6-win-amd64.egg\ortools\__init__.py". You can do so either manually or by using pip.

-----------------------------------------------------------------------------------------------
Message has been deleted

Yingjue

unread,
Sep 30, 2017, 3:16:32 PM9/30/17
to or-tools-discuss
Update:
I uninstalled the whole python, then started from scratch and pip installed the last stable version of ortools (6.3.4431).
python -m pip install py3-ortools==6.3.4431

Now it seems working fine on my machine.

Laurent Perron

unread,
Sep 30, 2017, 3:19:03 PM9/30/17
to or-tools...@googlegroups.com

This is not the last version. And I did not change the build process on Windows between the 6.3 and 6.4 release :-)


--

Yingjue

unread,
Sep 30, 2017, 3:26:37 PM9/30/17
to or-tools-discuss
Yes you are right. I mean "the PREVIOUS stable version of ortools (6.3.4431)". Sorry I am so happy at that moment and did not use the accurate wording ^_^

Many thanks for this great tool, Laurent!

Laurent Perron

unread,
Oct 2, 2017, 6:58:19 AM10/2/17
to or-tools-discuss
So, python 2.7 modules work fine on my machine.
I can reproduce the problem with python 3.6.

I continue my debug session.

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discuss+unsubscribe@googlegroups.com.

Laurent Perron

unread,
Oct 2, 2017, 7:32:27 AM10/2/17
to or-tools-discuss
It seems dlls were mixed up, and the python 3.6 modules is linked against a 3.5 python.
Can you try with python 3.5?

Thanks

Laurent Perron

unread,
Oct 2, 2017, 8:20:10 AM10/2/17
to or-tools-discuss
OK, 

I have managed to build everything correctly.
Hopefully, next release will include all the fixes

What a mess :-(

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


2017-10-02 13:32 GMT+02:00 Laurent Perron <laurent...@gmail.com>:
It seems dlls were mixed up, and the python 3.6 modules is linked against a 3.5 python.
Can you try with python 3.5?

Thanks
Le lun. 2 oct. 2017 à 12:58, 'Laurent Perron' via or-tools-discuss <or-tools-discuss@googlegroups.com> a écrit :
So, python 2.7 modules work fine on my machine.
I can reproduce the problem with python 3.6.

I continue my debug session.

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00

2017-09-30 21:26 GMT+02:00 Yingjue <zhouy...@gmail.com>:
Yes you are right. I mean "the PREVIOUS stable version of ortools (6.3.4431)". Sorry I am so happy at that moment and did not use the accurate wording ^_^

Many thanks for this great tool, Laurent!

On Saturday, September 30, 2017 at 12:19:03 PM UTC-7, Laurent Perron wrote:

This is not the last version. And I did not change the build process on Windows between the 6.3 and 6.4 release :-)


Le sam. 30 sept. 2017 à 21:16, Yingjue <zhouy...@gmail.com> a écrit :
Update:
I uninstalled the whole python, then started from scratch and pip installed the last stable version of ortools (6.3.4431).
python -m pip install py3-ortools==6.3.4431

Now it seems working fine on my machine.

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

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

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

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

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

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

Robbie Urwin

unread,
Oct 2, 2017, 4:44:21 PM10/2/17
to or-tools-discuss
I have now successfully installed the package! I tried your advice Laurent to install to Python 3.5 instead but unfortunately that didn't work either. However I took Yingjue's advice and pip installed 6.3.4431 and that worked fine.

Thanks for your help Laurent, really appreciated.Hope you can sort these issues for the next release!

Laurent Perron

unread,
Oct 3, 2017, 3:51:51 AM10/3/17
to or-tools-discuss
Next release is out.
If you run pip install ortools (not py3-ortools), you should pull the latest module (for python 3.6).

Tell me if it works.

--Laurent

PS: Uninstall py3-ortools before.

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


2017-10-02 22:44 GMT+02:00 Robbie Urwin <robbie...@hotmail.co.uk>:
I have now successfully installed the package! I tried your advice Laurent to install to Python 3.5 instead but unfortunately that didn't work either. However I took Yingjue's advice and pip installed 6.3.4431 and that worked fine.

Thanks for your help Laurent, really appreciated.Hope you can sort these issues for the next release!

--

Robbie Urwin

unread,
Oct 3, 2017, 2:35:48 PM10/3/17
to or-tools-discuss
Updating with pip worked fine. I now have ortools 6.5.4527 installed and working with Python 3.6. Thanks!

Laurent Perron

unread,
Oct 4, 2017, 3:35:28 AM10/4/17
to or-tools-discuss
Great.

Thanks

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


2017-10-03 20:35 GMT+02:00 Robbie Urwin <robbie...@hotmail.co.uk>:
Updating with pip worked fine. I now have ortools 6.5.4527 installed and working with Python 3.6. Thanks!

--
Reply all
Reply to author
Forward
0 new messages