Comments (4)
Original comment by Joshua Anderson (Bitbucket: joaander, GitHub: joaander).
I cannot reproduce this issue. The setup.py file includes
install_requires=['numpy'],
When I test the dependencies with the recommended test pip download gsd
, I get:
Collecting gsd
Using cached gsd-1.5.0.tar.gz
Saved ./gsd-1.5.0.tar.gz
Collecting numpy (from gsd)
Using cached numpy-1.14.1-cp36-cp36m-manylinux1_x86_64.whl
Saved ./numpy-1.14.1-cp36-cp36m-manylinux1_x86_64.whl
Successfully downloaded gsd numpy
So pip correctly sees that numpy is a dependency.
I am not a pypi expert. If you have suggestions on how to improve the setup.py
file in gsd, I welcome pull requests.
from gsd.
Original comment by tolejema (Bitbucket: tolejema, ).
It does not work because you are calling import numpy at the beginning of the setup.py before setup(...) is called.
Try something like that:
#!python
from setuptools import setup, find_packages
from setuptools.extension import Extension
try:
from numpy import get_include
except ImportError:
def get_include(*args,**kwargs):
from numpy import get_include
return get_include(*args,**kwargs)
import sys
import hashlib
current_checksum = hashlib.sha256()
with open('gsd/fl.pyx') as f:
current_checksum.update(f.read().encode('UTF-8'))
with open('gsd/fl.pyx.sha256') as f:
existing_checksum = f.read();
if existing_checksum.strip() != current_checksum.hexdigest():
print('fl.pyx has been updated, it needs to be cythonized before setup.py can continue.');
sys.exit(1);
setup(name = 'gsd',
version = '1.5.1',
description = 'General simulation data file format.',
license = 'BSD - 2 clause',
author = 'Joshua A. Anderson',
author_email = '[email protected]',
url = 'https://bitbucket.org/glotzer/gsd',
download_url = 'http://glotzerlab.engin.umich.edu/Downloads/gsd/gsd-v1.5.1.tar.gz',
classifiers=[
"Development Status :: 5 - Production/Stable",
'Intended Audience :: Developers',
"Intended Audience :: Science/Research",
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
"License :: OSI Approved :: BSD License",
"Topic :: Scientific/Engineering :: Physics",
],
setup_requires=['numpy'],
ext_modules = (Extension('gsd.fl',
sources=['gsd/fl{0}.c'.format(sys.version_info.major), 'gsd/gsd.c'],
include_dirs = [get_include()]
) for dummy in xrange(1)),
packages = ['gsd']
)
from gsd.
Original comment by Joshua Anderson (Bitbucket: joaander, GitHub: joaander).
Thanks for the suggestion. However, I tested this in a clean ubuntu 16.04 docker container and doesn't work with python2. Your technique of using a generator to delay the execution of get_include fails for python2 because it calls len
on ext_modules
:
File "/usr/lib/python2.7/distutils/dist.py", line 982, in has_ext_modules
return self.ext_modules and len(self.ext_modules) > 0
TypeError: object of type 'generator' has no len()
I found an alternate solution that works for both python2 and python3 here: https://stackoverflow.com/questions/19919905/how-to-bootstrap-numpy-installation-in-setup-py .
This fix will go out in the next release cycle gsd v1.5.2.
from gsd.
Original comment by Joshua Anderson (Bitbucket: joaander, GitHub: joaander).
Tested and working.
from gsd.
Related Issues (20)
- typeid saved incorrectly HOT 1
- Release v2.6.1
- Release v2.7.0
- Read scalar `hoomd` log data into a *pandas* `DataFrame`. HOT 1
- Release v2.8.0
- Release v2.8.1
- Provide high bandwidth performance for bulk frame writes. HOT 6
- Release gsd 2.9.0
- Release 3.0.0 HOT 5
- ValueError: signal only works in main thread of the main interpreter
- Add `HOOMDTrajectory.flush()`. HOT 2
- Release gsd 3.1.0
- Opening existing file with mode 'x' raises OSError instead of FileExistsError indicated by documentation HOT 1
- Release gsd 3.1.1
- Support Python 3.12.
- Release gsd 3.2.0
- v3.2.0 HTMLzip missing from gsd.readthedocs.io HOT 3
- Improve hoomd file write performance HOT 1
- Release gsd 3.2.1
- reduced precision HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gsd.