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

Problem with installation #4

Open
jorgesmok opened this issue Apr 19, 2017 · 28 comments
Open

Problem with installation #4

jorgesmok opened this issue Apr 19, 2017 · 28 comments

Comments

@jorgesmok
Copy link

jorgesmok commented Apr 19, 2017

Hello, I've tried to get PyNEC installed but instructions are a bit messed up all over different links (most likely I'm a beginner with this stuff so it's complicated for me). After I read some of your instructions regarding the installation of PyNEC, this is what I did:

git clone https://github.com/tmolteno/python-necpp.git
cd python-necpp
git submodule init
git submodule update --remote
cd PyNEC
./build.sh

But I got the following error after the last instruction (./build.sh):

~/python-necpp/necpp_src ~/python-necpp/PyNEC
libtoolize --force --copy
make: libtoolize: Command not found
Makefile.git:12: recipe for target 'all' failed
make: *** [all] Error 127
./build.sh: line 11: ./configure: No such file or directory
~/python-necpp/PyNEC
./build.sh: line 15: pandoc: command not found
Language subdirectory: python
Search paths:
./
./swig_lib/python/
/usr/share/swig3.0/python/
./swig_lib/
/usr/share/swig3.0/
Preprocessing...
Starting language-specific parse...
Processing types...
C++ analysis...
Processing nested classes...
Generating wrappers...
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying PyNEC.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_PyNEC' extension
creating build/necpp_src
creating build/necpp_src/src
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBUILD_PYTHON=1 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -I/usr/lib/python2.7/dist-packages/numpy/core/include -I../necpp_src/src -I../necpp_src/ -I/usr/include/python2.7 -c ../necpp_src/src/matrix_algebra.cpp -o build/temp.linux-x86_64-2.7/../necpp_src/src/matrix_algebra.o -fPIC
In file included from ../necpp_src/src/math_util.h:25:0,
from ../necpp_src/src/matrix_algebra.cpp:203:
../necpp_src/src/common.h:42:20: fatal error: config.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Please, could you help me with this?

@tmolteno
Copy link
Owner

Hi There. It looks like pandoc needs to be installed on your system. If you would just like to use the module, you should be able to install it from the python packaging pypi.org using

sudo pip install PyNEC

@jorgesmok
Copy link
Author

I forgot to mention, I'm trying to install it on Windows, however pip install PyNEC doesn't work, are you sure it is allocated at PyPI?

@tmolteno
Copy link
Owner

Looking into this. Seem's you're right.

@tmolteno
Copy link
Owner

Looks like I was using an old upload API. I've re-uploaded, but wont be able to check for a couple of hours. URL for package is now https://pypi.python.org/pypi/PyNEC/1.7.3.1

@jorgesmok
Copy link
Author

jorgesmok commented Sep 26, 2017

Now I got the following:

Collecting PyNEC
  Using cached PyNEC-1.7.3.1.tar.gz
Building wheels for collected packages: PyNEC
  Running setup.py bdist_wheel for PyNEC ... error
  Complete output from command C:\ProgramData\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Jorge\\AppData\\Local\\Temp\\pip-build-ygiykdtf\\PyNEC\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\Jorge\AppData\Local\Temp\tmp48_h706spip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  copying PyNEC.py -> build\lib.win-amd64-3.6
  running build_ext
  building '_PyNEC' extension
  creating build\temp.win-amd64-3.6
  creating build\temp.win-amd64-3.6\Release
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DBUILD_PYTHON=1 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -IC:\ProgramData\Anaconda3\lib\site-packages\numpy\core\include -I../necpp_src/src -I../necpp_src/ -IC:\ProgramData\Anaconda3\include -IC:\ProgramData\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-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" /EHsc /TpPyNEC_wrap.cxx /Fobuild\temp.win-amd64-3.6\Release\PyNEC_wrap.obj -fPIC
  cl : Command line warning D9002 : ignoring unknown option '-fPIC'
  PyNEC_wrap.cxx
  PyNEC_wrap.cxx(3062): fatal error C1083: Cannot open include file: 'src/math_util.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for PyNEC
  Running setup.py clean for PyNEC
Failed to build PyNEC
Installing collected packages: PyNEC
  Running setup.py install for PyNEC ... error
    Complete output from command C:\ProgramData\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Jorge\\AppData\\Local\\Temp\\pip-build-ygiykdtf\\PyNEC\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Jorge\AppData\Local\Temp\pip-3b7f9_a3-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    copying PyNEC.py -> build\lib.win-amd64-3.6
    running build_ext
    building '_PyNEC' extension
    creating build\temp.win-amd64-3.6
    creating build\temp.win-amd64-3.6\Release
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DBUILD_PYTHON=1 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -IC:\ProgramData\Anaconda3\lib\site-packages\numpy\core\include -I../necpp_src/src -I../necpp_src/ -IC:\ProgramData\Anaconda3\include -IC:\ProgramData\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-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" /EHsc /TpPyNEC_wrap.cxx /Fobuild\temp.win-amd64-3.6\Release\PyNEC_wrap.obj -fPIC
    cl : Command line warning D9002 : ignoring unknown option '-fPIC'
    PyNEC_wrap.cxx
    PyNEC_wrap.cxx(3062): fatal error C1083: Cannot open include file: 'src/math_util.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "C:\ProgramData\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Jorge\\AppData\\Local\\Temp\\pip-build-ygiykdtf\\PyNEC\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Jorge\AppData\Local\Temp\pip-3b7f9_a3-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Jorge\AppData\Local\Temp\pip-build-ygiykdtf\PyNEC\

I could install necpp but I'd like to use PyNEC as I've read it's easier and more powerful.

@tmolteno
Copy link
Owner

Looks like this isn't finding the source code at all. We haven't any windows machines here, but reading around, it seems like getting python packages to compile is a tricky business on windows. Solution is to build a binary wheel. I'll ask around and see if we can find one.

@jorgesmok
Copy link
Author

Did you find anything? Is there a way I can help make it work on windows? I don't know about packaging , but maybe if you guide me in the right direction...
I'm experiencing problems with necpp because I can't get the radiation pattern and would love to use PyNEC as it's more powerful and has more examples. I'm building a GUI on python and would like to keep everything in python, but if this has no solution, I will have to try C++ version of nec2++.

@jorgesmok
Copy link
Author

jorgesmok commented Nov 6, 2017

I actually just tested to see if I can get it installed on Linux (Ubuntu) and got the same error, it says it can't find the file src/math_util.h

Can you please verify this? Maybe it's a general error and by solving this it will work on Windows too.

Collecting PyNEC
  Using cached PyNEC-1.7.3.1.tar.gz
Building wheels for collected packages: PyNEC
  Running setup.py bdist_wheel for PyNEC ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-z_QcBC/PyNEC/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp9B1nn8pip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  copying PyNEC.py -> build/lib.linux-x86_64-2.7
  running build_ext
  building '_PyNEC' extension
  creating build/temp.linux-x86_64-2.7
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBUILD_PYTHON=1 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -I/usr/lib/python2.7/dist-packages/numpy/core/include -I../necpp_src/src -I../necpp_src/ -I/usr/include/python2.7 -c PyNEC_wrap.cxx -o build/temp.linux-x86_64-2.7/PyNEC_wrap.o -fPIC
  PyNEC_wrap.cxx:3062:27: fatal error: src/math_util.h: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for PyNEC
  Running setup.py clean for PyNEC
Failed to build PyNEC
Installing collected packages: PyNEC
  Running setup.py install for PyNEC ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-z_QcBC/PyNEC/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-FesViT-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    copying PyNEC.py -> build/lib.linux-x86_64-2.7
    running build_ext
    building '_PyNEC' extension
    creating build/temp.linux-x86_64-2.7
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBUILD_PYTHON=1 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -I/usr/lib/python2.7/dist-packages/numpy/core/include -I../necpp_src/src -I../necpp_src/ -I/usr/include/python2.7 -c PyNEC_wrap.cxx -o build/temp.linux-x86_64-2.7/PyNEC_wrap.o -fPIC
    PyNEC_wrap.cxx:3062:27: fatal error: src/math_util.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

@jorgesmok
Copy link
Author

Also, tried updating to necpp 1.7.3.2 and it also gave me an error on Ubuntu and Windows.

    necpp_wrap.c:3018:22: fatal error: libnecpp.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

So, it looks like both modules necpp and PyNEC aren't working, at least for me. Can you check this please?

@swissel
Copy link

swissel commented Dec 1, 2017

I get a similar error on Mac OS X:

bash-3.2$ sudo python setup.py install
running install
running build
running build_py
running build_ext
building '_PyNEC' extension
gcc -fno-strict-aliasing -I/Users/wissels/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -DBUILD_PYTHON=1 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -I/Users/wissels/anaconda/lib/python2.7/site-packages/numpy/core/include -I../necpp_src/src -I../necpp_src/ -I/Users/wissels/anaconda/include/python2.7 -c ../necpp_src/src/atlas_check.cpp -o build/temp.macosx-10.7-x86_64-2.7/../necpp_src/src/atlas_check.o -fPIC
gcc -fno-strict-aliasing -I/Users/wissels/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -DBUILD_PYTHON=1 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -I/Users/wissels/anaconda/lib/python2.7/site-packages/numpy/core/include -I../necpp_src/src -I../necpp_src/ -I/Users/wissels/anaconda/include/python2.7 -c ../necpp_src/src/c_evlcom.cpp -o build/temp.macosx-10.7-x86_64-2.7/../necpp_src/src/c_evlcom.o -fPIC
In file included from ../necpp_src/src/c_evlcom.cpp:18:
In file included from ../necpp_src/src/c_evlcom.h:21:
In file included from ../necpp_src/src/math_util.h:25:
../necpp_src/src/common.h:42:10: fatal error: 'config.h' file not found
#include "config.h"
^
1 error generated.
error: command 'gcc' failed with exit status 1

@rounaksingh
Copy link
Contributor

Hi guys,
Please post the python version and windows, mac versions you are using.
I am working to make few python wheels for windows now.
I do not have mac book. But I will post a solution and how to create a wheel soon.

Thanks

@rounaksingh
Copy link
Contributor

rounaksingh commented Dec 5, 2017

Hi guys,
I have created some wheels, please try them. Let me know if they work.
PyNEC_wheels

Check your python/os arch and Install them directly. No need to build anything. :) It is seriously required for windows.
$ pip install path/to/wheel/wheel_name.whl

I will try to add wheels for more platforms as I will get time.

Thanks
#6

rounaksingh added a commit to rounaksingh/python-necpp that referenced this issue Dec 5, 2017
@jorgesmok
Copy link
Author

Awesome! Worked perfectly on Windows 10 (Anaconda Python 3.6.2).

Some weeks ago I could get PyNEC installed on Linux by installing pandoc and libtool and modifying some C files, and I could get it done on windows by using MinGW and MSYS. But that was so tedious.

These wheels make it so much easy to install! I tested some examples and it worked fine. Thank you so much, I would like to have wheels for Python 3.5 (amd64), please let me know if you make them or tell me how to.

@rounaksingh
Copy link
Contributor

rounaksingh commented Dec 6, 2017

I have uploaded a wheel for py35_win_amd64.

Instructions on how to is on the link
https://github.com/rounaksingh/python-necpp/blob/devel/PyNEC/README.md

I have sent a pull request to @tmolteno. hopefully, it will be merge soon.

More info on wheels
https://packaging.python.org/
There are also nice videos about wheels on youtube.

@aplaccount
Copy link

Hi rounaksingh, could you check your permissions for the wheels? I can't seem to download them. Thanks!

@Aetesam-Ashar
Copy link

Could you tell me how to install a wheel. I've pretty much done everything upto now. I use Windows 7 and Python 3.6.5. It shows the same error. So I checked the link with the wheels but I don't know how to install them. If anyone could help I would appreciate it.

@tmolteno
Copy link
Owner

I have just merged the pull request. If someone with a windows machine could try an install from PyPi using pip, I would be most grateful to hear if its working.

@Habraken
Copy link

I have attempted to use pip install PyNEC as well as necpp on OSX 10.6. Both installs fail with the following error code:

warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from necpp_src/src/nec_radiation_pattern.cpp:19:
In file included from necpp_src/src/nec_radiation_pattern.h:22:
necpp_src/src/nec_results.h:21:10: fatal error: 'vector' file not found
#include
^~~~~~~~
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3q/4jqvxwnd4d9gfxt7rj0fw4sr0000gn/T/pip-install-lbr_puoq/PyNEC/setup.py'"'"'; file='"'"'/private/var/folders/3q/4jqvxwnd4d9gfxt7rj0fw4sr0000gn/T/pip-install-lbr_puoq/PyNEC/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/3q/4jqvxwnd4d9gfxt7rj0fw4sr0000gn/T/pip-record-ab597yh4/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m/PyNEC Check the logs for full command output.

What am I doing wrong or what am I missing here?
Many thanks in advance!

@danzimmerman
Copy link

I have just merged the pull request. If someone with a windows machine could try an install from PyPi using pip, I would be most grateful to hear if its working.

I'm trying to install PyNEC on my new Windows 10 laptop in an Anaconda virtual environment and not having luck.

I get the impression that pip install PyNEC should be pulling a binary wheel from PyPI at this point, but on my machine it's still trying to build a wheel and failing somewhere in distutils.

Detailed notes are in this github gist

As I note there, I did get PyNEC installed last year from source but I don't remember precisely how. That is also not working and I'll fill those notes in later.

Is it generally working from PyPI with Windows 10 users?

Great tool, by the way. Will keep trying to take detailed notes as I attempt to get it installed here.

@danzimmerman
Copy link

danzimmerman commented Aug 5, 2020

I upgraded pip and pip install pynec is failing with

DEPRECATION: Could not build wheels for pynec which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.

Full traceback is the same as before, but with the above message after it, I think suggesting that the re-try with setup.py will be removed soon. See here for the full error.

@danzimmerman
Copy link

danzimmerman commented Aug 5, 2020

I updated my gist with these instructions on how I was able to install PyNEC from source on Windows 10 in an Anaconda 3 virtual environment.

I am going to go back through this again to see if I can do this with git bash, but build.sh didn't run on my machine and the other steps didn't work without it.

I still have no idea how to get the pypi install to work. I think it might be related to the softlink issue. Will explore further, but I wanted to post this in case it's helpful for other Win10 users.

A little moot, given that once you have Ubuntu installed on the Windows Subsystem for Linux you could just run PyNEC on Linux, but I prefer to have it in my Windows Anaconda installation.

@danzimmerman
Copy link

danzimmerman commented Aug 8, 2020

I was incorrect. My instructions in the github gist do not work.

However, on my machine pip install PyNEC=1.7.3.4 does work. It builds a wheel, which maybe most Windows users are not set up for.

I'm having issues with version 1.7.3.6 on all of my available platforms. I'm getting ModuleNotFoundError on Windows (after following my convoluted instructions to apparently successfully install it from source)

1.7.3.6 installs immediately with pip3 install PyNEC on Ubuntu running on WSL, but also gives a ModuleNotFoundError on import.

Same issue on Google Colab running !pip install PyNEC in a cell.

Colab notebook here showing the issue.

I'm pretty confused by this because I'm pretty sure I had 1.7.3.6 working on WSL and Windows Python installs but obviously I've made some kind of error.

@Neon22
Copy link

Neon22 commented Jan 21, 2021

Just tried to install for python 3.9.
First error message ind-cated numpy needed to be installed beforehand.
installed numpy then PyNEC again.
Alas not successful.
Used - pip install PyNEC --user

Got this: possibly indicating setuptools problem ??

Collecting pynec
Using cached PyNEC-1.7.3.6.tar.gz (24 kB)
Using legacy 'setup.py install' for pynec, since package 'wheel' is not installed.
Installing collected packages: pynec
Running setup.py install for pynec ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Asus\AppData\Local\Temp\pip-install-slhpq5un\pynec_c657f5bb2b7f4587a277cba97ef4fb77\setup.py'"'"'; file='"'"'C:\Users\Asus\AppData\Local\Temp\pip-install-slhpq5un\pynec_c657f5bb2b7f4587a277cba97ef4fb77\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Asus\AppData\Local\Temp\pip-record-tdeozts_\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Asus\AppData\Roaming\Python\Python39\Include\pynec'
cwd: C:\Users\Asus\AppData\Local\Temp\pip-install-slhpq5un\pynec_c657f5bb2b7f4587a277cba97ef4fb77
Complete output (60 lines):
running install
running build
running build_py
file PyNEC.py (for module PyNEC) not found
file PyNEC.py (for module PyNEC) not found
running egg_info
writing PyNEC.egg-info\PKG-INFO
writing dependency_links to PyNEC.egg-info\dependency_links.txt
writing top-level names to PyNEC.egg-info\top_level.txt
file PyNEC.py (for module PyNEC) not found
reading manifest file 'PyNEC.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'necpp_src\src*.h'
warning: no files found matching 'necpp_src\config.h'
writing manifest file 'PyNEC.egg-info\SOURCES.txt'
running build_ext
building 'PyNEC' extension
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Asus\AppData\Local\Temp\pip-install-slhpq5un\pynec_c657f5bb2b7f4587a277cba97ef4fb77\setup.py", line 51, in
setuptools.setup (name = 'PyNEC',
File "c:\python39\lib\site-packages\setuptools_init
.py", line 165, in setup
return distutils.core.setup(**attrs)
File "c:\python39\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python39\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\python39\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\python39\lib\distutils\command\install.py", line 546, in run
self.run_command('build')
File "c:\python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\python39\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\python39\lib\site-packages\setuptools\command\build_ext.py", line 87, in run
_build_ext.run(self)
File "c:\python39\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "c:\python39\lib\distutils\command\build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "c:\python39\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "c:\python39\lib\site-packages\setuptools\command\build_ext.py", line 208, in build_extension
build_ext.build_extension(self, ext)
File "c:\python39\lib\distutils\command\build_ext.py", line 551, in build_extension
self.compiler.link_shared_object(
File "c:\python39\lib\distutils\ccompiler.py", line 713, in link_shared_object
self.link(CCompiler.SHARED_OBJECT, objects,
File "c:\python39\lib\distutils_msvccompiler.py", line 479, in link
build_temp = os.path.dirname(objects[0])
IndexError: list index out of range
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Asus\AppData\Local\Temp\pip-install-slhpq5un\pynec_c657f5bb2b7f4587a277cba97ef4fb77\setup.py'"'"'; file='"'"'C:\Users\Asus\AppData\Local\Temp\pip-install-slhpq5un\pynec_c657f5bb2b7f4587a277cba97ef4fb77\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Asus\AppData\Local\Temp\pip-record-tdeozts
\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Asus\AppData\Roaming\Python\Python39\Include\pynec' Check the logs for full command output.

@kwiadnyana
Copy link

On my Windows10 machine pip install PyNEC==1.7.3.4 works. It builds a wheel too.
Thanks to @danzimmerman

@Neon22
Copy link

Neon22 commented Aug 22, 2022

yes thanks. working for me pip install --user PyNEC==1.7.3.4

@glenndk
Copy link

glenndk commented Apr 1, 2024

Have somebody tested PyNEC==1.7.3.6 - it ought to work?:
#19 (comment)

@adriaanph
Copy link

@glenndk & others: i have just tried 1.7.3.6 (windows 10, python 3.10, "pip install pynec==1.7.3.6") and it does not work:

  1. pip seems to install correctly
  2. python: import PyNEC" fails with "Module not found"

simply installing 1.7.3.4 works ("pip install pynec==1.7.3.4" - which un-installs 1.7.3.6).

@tfblum
Copy link

tfblum commented Sep 6, 2024

@tmolteno and @glenndk I was able to successfully install pynec 1.7.3.6 in a python 3.12 conda environment on my Mac (MacOS 12.7.6). I have Xcode command line tools installed and I built in the attached environment. I had to change line 6 of the Makefile.git in necpp_src to:
LIBTOOLIZE=libtoolize

since I'm using a libtool package installed with conda I needed to use libtoolize instead of glibtoolize.

after making the environment, cloning the repository and editing Makefile.git I followed the stated build and install instructions.

monopole.py, dipole.py, and impedance_plot.py all work for me. monopole realistic ground is not working for me however. see issue #30 here

conda_env_export.txt

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