Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no prebuilt binary for python 3.5 #32

Closed
GitH00t opened this issue Nov 4, 2015 · 6 comments
Closed

no prebuilt binary for python 3.5 #32

GitH00t opened this issue Nov 4, 2015 · 6 comments

Comments

@GitH00t
Copy link

GitH00t commented Nov 4, 2015

Greetings,

I am having problems with installing cpymad via pip.
This is the log I get. Sorry for not reformatting, but I don't get it...

C:\TEMP>pip install cpymad
Collecting cpymad
Using cached cpymad-0.12.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\anaconda3\lib\site-packages\setuptools-18.4-py3.5.egg (from cpymad)
Requirement already satisfied (use --upgrade to upgrade): numpy in c:\anaconda3\lib\site-packages (from cpymad)
Requirement already satisfied (use --upgrade to upgrade): PyYAML in c:\anaconda3\lib\site-packages (from cpymad)
Building wheels for collected packages: cpymad
Running setup.py bdist_wheel for cpymad
Complete output from command C:\Anaconda3\python.exe -c "import setuptools;file='C:\Users\TKU\AppData\Local\Temp\pip-build-1f1l3aby\cpymad\setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" bdist_w
heel -d C:\Users\TKU\AppData\Local\Temp\tmpoebtrsukpip-wheel-:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\cpymad
copying cpymad\madx.py -> build\lib.win-amd64-3.5\cpymad
copying cpymad\types.py -> build\lib.win-amd64-3.5\cpymad
copying cpymad\util.py -> build\lib.win-amd64-3.5\cpymad
copying cpymad_rpc.py -> build\lib.win-amd64-3.5\cpymad
copying cpymad__init__.py -> build\lib.win-amd64-3.5\cpymad
creating build\lib.win-amd64-3.5\cpymad\rpc_util
copying cpymad\rpc_util\client.py -> build\lib.win-amd64-3.5\cpymad\rpc_util
copying cpymad\rpc_util\connection.py -> build\lib.win-amd64-3.5\cpymad\rpc_util
copying cpymad\rpc_util\file_monitor.py -> build\lib.win-amd64-3.5\cpymad\rpc_util
copying cpymad\rpc_util\ipc.py -> build\lib.win-amd64-3.5\cpymad\rpc_util
copying cpymad\rpc_util\posix.py -> build\lib.win-amd64-3.5\cpymad\rpc_util
copying cpymad\rpc_util\service.py -> build\lib.win-amd64-3.5\cpymad\rpc_util
copying cpymad\rpc_util\windows.py -> build\lib.win-amd64-3.5\cpymad\rpc_util
copying cpymad\rpc_util__init__.py -> build\lib.win-amd64-3.5\cpymad\rpc_util
running egg_info
writing dependency_links to cpymad.egg-info\dependency_links.txt
writing cpymad.egg-info\PKG-INFO
writing top-level names to cpymad.egg-info\top_level.txt
writing requirements to cpymad.egg-info\requires.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'cpymad.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'cpymad.egg-info\SOURCES.txt'
copying cpymad\clibmadx.pxd -> build\lib.win-amd64-3.5\cpymad
copying cpymad\libmadx.c -> build\lib.win-amd64-3.5\cpymad
copying cpymad\libmadx.pyx -> build\lib.win-amd64-3.5\cpymad
creating build\lib.win-amd64-3.5\cpymad\COPYING
copying cpymad\COPYING\cpymad.rst -> build\lib.win-amd64-3.5\cpymad\COPYING
copying cpymad\COPYING\madx.rst -> build\lib.win-amd64-3.5\cpymad\COPYING
running build_ext
building 'cpymad.libmadx' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\cpymad
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Anaconda3\include -IC:\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)
\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10150.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\P
rogram Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tccpymad/libmadx.c /Fobuild\temp.win-amd64-3.5\Release\cpymad/libmadx.obj -std=gnu99
cl : Befehlszeile warning D9002 : Unbekannte Option "-std=gnu99" wird ignoriert.
libmadx.c
cpymad/libmadx.c(257): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "madX/mad_def.h": No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe' failed with exit status 2


Failed building wheel for cpymad
Failed to build cpymad
Installing collected packages: cpymad
Running setup.py install for cpymad
Complete output from command C:\Anaconda3\python.exe -c "import setuptools, tokenize;file='C:\Users\TKU\AppData\Local\Temp\pip-build-1f1l3aby\cpymad\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r
\n', '\n'), file, 'exec'))" install --record C:\Users\TKU\AppData\Local\Temp\pip-jl3uinjp-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
running egg_info
writing requirements to cpymad.egg-info\requires.txt
writing dependency_links to cpymad.egg-info\dependency_links.txt
writing cpymad.egg-info\PKG-INFO
writing top-level names to cpymad.egg-info\top_level.txt
warning: manifest_maker: standard file '-c' not found

reading manifest file 'cpymad.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'cpymad.egg-info\SOURCES.txt'
running build_ext
building 'cpymad.libmadx' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Anaconda3\include -IC:\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x8

6)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10150.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:
\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tccpymad/libmadx.c /Fobuild\temp.win-amd64-3.5\Release\cpymad/libmadx.obj -std=gnu99
cl : Befehlszeile warning D9002 : Unbekannte Option "-std=gnu99" wird ignoriert.
libmadx.c
cpymad/libmadx.c(257): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "madX/mad_def.h": No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Anaconda3\python.exe -c "import setuptools, tokenize;file='C:\Users\TKU\AppData\Local\Temp\pip-build-1f1l3aby\cpymad\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'e
xec'))" install --record C:\Users\TKU\AppData\Local\Temp\pip-jl3uinjp-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\TKU\AppData\Local\Temp\pip-build-1f1l3aby\cpymad

C:\TEMP>

@coldfix
Copy link
Member

coldfix commented Nov 4, 2015

Hey,

looks like cpymad is trying to build from source rather than using the prebuilt binaries. What is your platform (python version, architecture, OS)? In case there is no binary for your platform, I could try to build one later on.

In case there is a matching binary for your platform online, did you try downloading the wheel (.whl) and installing the file directly?

If you do want to build cpymad on your own you will need to download and build the MAD-X sources first as is described in the installation guide (be warned, you need a working compiler suite for that, including fortran!).

Regarding the formatting: just put triple back ticks around your log example:

```
C:\TEMP>pip install cpymad
Collecting cpymad
Using cached cpymad-0.12.2.tar.gz
```

@GitH00t
Copy link
Author

GitH00t commented Nov 4, 2015

3.5.0 |Anaconda 2.4.0 (64-bit)| (default, Oct 20 2015, 07:26:33) [MSC v.1900 64 bit (AMD64)] on Win7
So there is no binary available. I do not want to build it myself. That would only get me into more trouble than I am already in.

I tried using the "best-fitting" wheel and get the following:

cpymad-0.12.2-cp34-none-win_amd64.whl is not a supported wheel on this platform.

Will I have to downgrade to py3.4 to make it work again?

Renaming the file to cpymad-0.12.2-cp34-none-any.whl allowed me to use the wheel, but that was probably dirtier than anything, because now:

from cpymad.madx import Madx
m = Madx()

throws:

ImportError:
Traceback (most recent call last):
  File "C:\Anaconda3\lib\site-packages\cpymad\rpc_util\service.py", line 85, in _dispatch
    response = handler(*args)
  File "C:\Anaconda3\lib\site-packages\cpymad\_rpc.py", line 109, in _dispatch_function_call
    module = __import__(modname, None, None, '*')
ImportError: DLL load failed: The specified module could not be found.

@coldfix
Copy link
Member

coldfix commented Nov 4, 2015

OK, I'm afraid, I cannot build a reliable windows binary for python 3.5 at this time. Can you go back to python 3.4 for the time being? As soon, as there is a WinPython release for python 3.5, I can provide the corresponding binary.

@coldfix
Copy link
Member

coldfix commented Nov 4, 2015

Might be a while until WinPython 3.5 will be released. Apparently, there is some trouble with the compiler toolchain.

winpython/winpython#67

As of now, I can only provide cpymad builds for python3.5 that dynamically link to some DLLs you'd have to download manually.

EDIT: (a few more readings)

https://blogs.msdn.microsoft.com/vcblog/2014/06/10/the-great-c-runtime-crt-refactoring
https://blogs.msdn.microsoft.com/vcblog/2015/03/03/introducing-the-universal-crt
http://stevedower.id.au/blog/building-for-python-3-5
http://stevedower.id.au/blog/building-for-python-3-5-part-two
http://stevedower.id.au/blog/the-python-3-5-installer/#comment-275

See also:

https://mingwpy.github.io/issues.html#choice-of-msvc-runtime (good overview!)
https://mingwpy.github.io/ucrt.html (technical background, good explanation!)
mingwpy/mingwpy#25

@GitH00t
Copy link
Author

GitH00t commented Nov 4, 2015

Alright, so I now reverted back to Py 3.4 and it seems to work now. Looking at all the troubles I had with upgrading the entire distribution (numpy, matplotlib and such). I will stick to the out of the box version I have right now and wait for things to settle.
Thanks for your support! I leave it up to you if you want to close the ticket.

@coldfix coldfix changed the title cannot install cpymad via pip no prebuilt binary for python 3.5 Nov 4, 2015
coldfix added a commit that referenced this issue Mar 25, 2018
- command/element etc:
    * retrieve information about commands from MAD-X ``defined_commands`` and
      store in ``Command`` instances.
    * use ``Command`` to improve command string generation and type-checks in
      ``util.mad_command`` (#9)
    * quote filename parameters when composing command string
    * use deferred expressions (``:=``) whenever passing strings to
      non-string parameters (#11)
    * subclass elements, beam from ``Command``
    * support attribute access for table/mappings/commands/elements/beams etc
    * allow case-insensitive access
    * overload index-access in tables to retrieve rows
    * implement ``Element.__delitem__`` by setting value to default
    * return name for global elements too
    * add ``Madx.base_types`` data variable that yields the base elements
    * add ``Element.parent``/``base_type`` attributes
    * more concise string representations
    * strip -Proxy suffix from class names
    * apply user defined row/column selections even when no output file is
      specified

- installation:
    * automatically use ``-lquadmath``
    * add ``--static`` flag for setup script, use ``--shared`` by default
    * no more need to link against PTC shared object separately
    * finally provide some binary wheels for py 3.5 and 3.6 (#32)

- raise cython language_level to 3
@coldfix
Copy link
Member

coldfix commented Mar 25, 2018

Hi, FYI I have uploaded py35 and py36 wheels for the newest cpymad version. However, these are experimental and crashed regularly on win10 64bit during testing. Other configurations (win7 with 32/64bit or win10 with 32bit) seemed to work but I can't guarantee that they are fine. Furthermore, you may have to download MSVCR100.dll manually.

Best, Thomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants