Erlinska
Erlinska

Reputation: 433

Looking for help on installing a numpy extension

I found a numpy extension on github that would be really helpful for a program I'm currently writting, however I don't know how to install it.

Here's the link to the extension: https://pypi.python.org/pypi?name=py_find_1st&:action=display

I'm using windows 10 which might be the reason why the installer provided doesn't work, I found a file looking like a numpy extension as described here: https://docs.scipy.org/doc/numpy-1.10.0/user/c-info.how-to-extend.html

But there's no mention on this page of where to put the code of the numpy extension, and I didn't manage to find any explanations online.

Would anyone have an idea on how to install this?

Upvotes: 1

Views: 204

Answers (2)

Erlinska
Erlinska

Reputation: 433

Error message when trying to install the extension using the cmd:

D:\Chrome dl\py_find_1st-1.0.6\py_find_1st-1.0.6>python setup.py install
running install
running bdist_egg
running egg_info
creating py_find_1st.egg-info
writing py_find_1st.egg-info\PKG-INFO
writing dependency_links to py_find_1st.egg-info\dependency_links.txt
writing top-level names to py_find_1st.egg-info\top_level.txt
writing manifest file 'py_find_1st.egg-info\SOURCES.txt'
reading manifest file 'py_find_1st.egg-info\SOURCES.txt'
writing manifest file 'py_find_1st.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\utils_find_1st
copying utils_find_1st\__init__.py -> build\lib.win-amd64-3.5\utils_find_1st
running build_ext
Traceback (most recent call last):
  File "setup.py", line 117, in <module>
    zip_safe = False,
  File "D:\Anaconda\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "D:\Anaconda\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "D:\Anaconda\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\install.py", line 67, in run
  File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\install.py", line 109, in do_egg_install
  File "D:\Anaconda\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "D:\Anaconda\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\bdist_egg.py", line 161, in run
  File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\bdist_egg.py", line 147, in call_command
  File "D:\Anaconda\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "D:\Anaconda\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\install_lib.py", line 11, in run
  File "D:\Anaconda\lib\distutils\command\install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "D:\Anaconda\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "D:\Anaconda\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "D:\Anaconda\lib\distutils\command\build_ext.py", line 338, in run
    self.build_extensions()
  File "setup.py", line 42, in build_extensions
    if compiler_is_clang(self.compiler.compiler):
AttributeError: 'MSVCCompiler' object has no attribute 'compiler'

Upvotes: 0

liam
liam

Reputation: 2014

To build any extension modules for Python, you’ll need a C compiler. Various NumPy modules use FORTRAN 77 libraries, so you’ll also need a FORTRAN 77 compiler installed.

However, if you just want to install the tar.gz file that they have on the website, follow these steps:

  1. Open cmd (Command Prompt)
  2. Write set path=%path%;C:\Python27\
  3. Extract the tar.gz file (use a program like PeaZip)
  4. Change directories within the command line (if you are confused on how to do this look here for reference)
  5. Get to your files' directory (something like cd c:\Users\pdxNat\Downloads\py_find_1st1.0.6)
  6. Run python setup.py install

Upvotes: 1

Related Questions