PrincetonUniversity / DP_GP_cluster

BSD 3-Clause "New" or "Revised" License
73 stars 25 forks source link

Unable to run after following installation instructions #1

Open cbonnett opened 7 years ago

cbonnett commented 7 years ago

While running the test:

DP_GP_cluster.py -i test/test.txt -o test/test -p png -n 20 --plot

I get the following error:

    from DP_GP import core
ImportError: cannot import name core

The install doesn't report any problems. Any idea what might be going on ?

IanMcDowell commented 7 years ago

Can you reinstall and send me all standard error?

What platform are you working on? This has only been tested on linux.

On Wed, May 3, 2017 at 4:26 AM, Christopher Bonnett < notifications@github.com> wrote:

from DP_GP import core

ImportError: cannot import name core

The install doesn't report any problems. Any idea what might be going on ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_PrincetonUniversity_DP-5FGP-5Fcluster_issues_1&d=DwMCaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=QGd0b_06v3hDpkoxZUB9c2iQ5RMTOts_DJ98uEZzA-o&m=HUhnyzW8mlEEKZUfx6UEItnPPtvkwZBncI0ReqmNfxM&s=mJNOavVc71svhBH49flhiptKiSZyIfH-S4Rdwgh-G1U&e=, or mute the thread https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AFnc9KOG-5FGamTLwe49U-2D-5FDQ-2DeM3Y8HvDks5r2DoZgaJpZM4NPFpB&d=DwMCaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=QGd0b_06v3hDpkoxZUB9c2iQ5RMTOts_DJ98uEZzA-o&m=HUhnyzW8mlEEKZUfx6UEItnPPtvkwZBncI0ReqmNfxM&s=xUr6IzL7xO411zuyEQ1ZebLBb38o4jHvOiUDMZr08xw&e= .

cbonnett commented 7 years ago

This was on linux I tried on mac and gave me same error

All happens within a conda python 2.7 environment.

Here is full output of the install procedure from linux machine (full error after running is below):

running install running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/DP_GP copying DP_GP/utils.py -> build/lib.linux-x86_64-2.7/DP_GP copying DP_GP/init.py -> build/lib.linux-x86_64-2.7/DP_GP copying DP_GP/plot.py -> build/lib.linux-x86_64-2.7/DP_GP running build_ext skipping 'DP_GP/core.c' Cython extension (up-to-date) building 'DP_GP.core' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/DP_GP gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include -I/home/cbonnett/anaconda3/envs/py27/include/python2.7 -c DP_GP/core.c -o build/temp.linux-x86_64-2.7/DP_GP/core.o In file included from /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1788:0, from /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18, from /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from DP_GP/core.c:407: /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it by " \

^ gcc -pthread -shared -L/home/cbonnett/anaconda3/envs/py27/lib -Wl,-rpath=/home/cbonnett/anaconda3/envs/py27/lib,--no-as-needed build/temp.linux-x86_64-2.7/DP_GP/core.o -L/home/cbonnett/anaconda3/envs/py27/lib -lpython2.7 -o build/lib.linux-x86_64-2.7/DP_GP/core.so skipping 'DP_GP/cluster_tools.c' Cython extension (up-to-date) building 'DP_GP.cluster_tools' extension gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include -I/home/cbonnett/anaconda3/envs/py27/include/python2.7 -c DP_GP/cluster_tools.c -o build/temp.linux-x86_64-2.7/DP_GP/cluster_tools.o In file included from /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1788:0, from /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18, from /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from DP_GP/cluster_tools.c:406: /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it by " \

^ gcc -pthread -shared -L/home/cbonnett/anaconda3/envs/py27/lib -Wl,-rpath=/home/cbonnett/anaconda3/envs/py27/lib,--no-as-needed build/temp.linux-x86_64-2.7/DP_GP/cluster_tools.o -L/home/cbonnett/anaconda3/envs/py27/lib -lpython2.7 -o build/lib.linux-x86_64-2.7/DP_GP/cluster_tools.so running build_scripts creating build/scripts-2.7 copying and adjusting bin/DP_GP_cluster.py -> build/scripts-2.7 changing mode of build/scripts-2.7/DP_GP_cluster.py from 664 to 775 running install_lib copying build/lib.linux-x86_64-2.7/DP_GP/utils.py -> /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP copying build/lib.linux-x86_64-2.7/DP_GP/init.py -> /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP copying build/lib.linux-x86_64-2.7/DP_GP/core.so -> /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP copying build/lib.linux-x86_64-2.7/DP_GP/cluster_tools.so -> /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP copying build/lib.linux-x86_64-2.7/DP_GP/plot.py -> /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP byte-compiling /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP/utils.py to utils.pyc byte-compiling /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP/init.py to init.pyc byte-compiling /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP/plot.py to plot.pyc running install_scripts copying build/scripts-2.7/DP_GP_cluster.py -> /home/cbonnett/anaconda3/envs/py27/bin changing mode of /home/cbonnett/anaconda3/envs/py27/bin/DP_GP_cluster.py to 775 running install_egg_info Removing /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP_cluster-0.1-py2.7.egg-info Writing /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP_cluster-0.1-py2.7.egg-info

Error returned :

DP_GP_cluster.py -i test/test.txt -o test/test -p png -n 20 --plot Traceback (most recent call last): File "/home/cbonnett/anaconda3/envs/py27/bin/DP_GP_cluster.py", line 26, in from DP_GP import core ImportError: cannot import name core

IanMcDowell commented 7 years ago

It does indeed look like it installed properly. Could you try and run the test from another directory (e.g. home dir)? Modifying the relative paths as necessary, of course. Please send me the output from that.

On Wed, May 3, 2017 at 10:35 AM, Christopher Bonnett < notifications@github.com> wrote:

This was on linux I tried on mac and gave me same error

All happens within a conda python 2.7 environment.

Here is full output of the install procedure from linux machine (full error after running is below):

running install running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/DP_GP copying DP_GP/utils.py -> build/lib.linux-x86_64-2.7/DP_GP copying DP_GP/init.py -> build/lib.linux-x86_64-2.7/DP_GP copying DP_GP/plot.py -> build/lib.linux-x86_64-2.7/DP_GP running build_ext skipping 'DP_GP/core.c' Cython extension (up-to-date) building 'DP_GP.core' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/DP_GP gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/cbonnett/anaconda3/ envs/py27/lib/python2.7/site-packages/numpy/core/include -I/home/cbonnett/anaconda3/envs/py27/include/python2.7 -c DP_GP/core.c -o build/temp.linux-x86_64-2.7/DP_GP/core.o In file included from /home/cbonnett/anaconda3/envs/ py27/lib/python2.7/site-packages/numpy/core/include/ numpy/ndarraytypes.h:1788:0, from /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site- packages/numpy/core/include/numpy/ndarrayobject.h:18, from /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site- packages/numpy/core/include/numpy/arrayobject.h:4, from DP_GP/core.c:407: /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site- packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning:

warning "Using deprecated NumPy API, disable it by " "#defining

NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it by "

^ gcc -pthread -shared -L/home/cbonnett/anaconda3/envs/py27/lib -Wl,-rpath=/home/cbonnett/anaconda3/envs/py27/lib,--no-as-needed build/temp.linux-x86_64-2.7/DP_GP/core.o -L/home/cbonnett/anaconda3/envs/py27/lib -lpython2.7 -o build/lib.linux-x86_64-2.7/DP_GP/core.so skipping 'DP_GP/cluster_tools.c' Cython extension (up-to-date) building 'DP_GP.cluster_tools' extension gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/cbonnett/anaconda3/ envs/py27/lib/python2.7/site-packages/numpy/core/include -I/home/cbonnett/anaconda3/envs/py27/include/python2.7 -c DP_GP/cluster_tools.c -o build/temp.linux-x86_64-2.7/DP_GP/cluster_tools.o In file included from /home/cbonnett/anaconda3/envs/ py27/lib/python2.7/site-packages/numpy/core/include/ numpy/ndarraytypes.h:1788:0, from /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site- packages/numpy/core/include/numpy/ndarrayobject.h:18, from /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site- packages/numpy/core/include/numpy/arrayobject.h:4, from DP_GP/cluster_tools.c:406: /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site- packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning:

warning "Using deprecated NumPy API, disable it by " "#defining

NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it by "

^ gcc -pthread -shared -L/home/cbonnett/anaconda3/envs/py27/lib -Wl,-rpath=/home/cbonnett/anaconda3/envs/py27/lib,--no-as-needed build/temp.linux-x86_64-2.7/DP_GP/cluster_tools.o -L/home/cbonnett/anaconda3/envs/py27/lib -lpython2.7 -o build/lib.linux-x86_64-2.7/DP_GP/cluster_tools.so running build_scripts creating build/scripts-2.7 copying and adjusting bin/DP_GP_cluster.py -> build/scripts-2.7 changing mode of build/scripts-2.7/DP_GP_cluster.py from 664 to 775 running install_lib copying build/lib.linux-x86_64-2.7/DP_GP/utils.py -> /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP copying build/lib.linux-x86_64-2.7/DP_GP/init.py -> /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP copying build/lib.linux-x86_64-2.7/DP_GP/core.so -> /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP copying build/lib.linux-x86_64-2.7/DP_GP/cluster_tools.so -> /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP copying build/lib.linux-x86_64-2.7/DP_GP/plot.py -> /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP byte-compiling /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP/utils.py to utils.pyc byte-compiling /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site- packages/DP_GP/init.py to init.pyc byte-compiling /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site-packages/DP_GP/plot.py to plot.pyc running install_scripts copying build/scripts-2.7/DP_GP_cluster.py -> /home/cbonnett/anaconda3/envs/py27/bin changing mode of /home/cbonnett/anaconda3/envs/py27/bin/DP_GP_cluster.py to 775 running install_egg_info Removing /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site- packages/DP_GP_cluster-0.1-py2.7.egg-info Writing /home/cbonnett/anaconda3/envs/py27/lib/python2.7/site- packages/DP_GP_cluster-0.1-py2.7.egg-info

Error returned :

DP_GP_cluster.py -i test/test.txt -o test/test -p png -n 20 --plot Traceback (most recent call last): File "/home/cbonnett/anaconda3/envs/py27/bin/DP_GP_cluster.py", line 26, in from DP_GP import core ImportError: cannot import name core

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_PrincetonUniversity_DP-5FGP-5Fcluster_issues_1-23issuecomment-2D298929706&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=QGd0b_06v3hDpkoxZUB9c2iQ5RMTOts_DJ98uEZzA-o&m=KHpR0ILuNJVK9DGFF-h7jV5Ij6kk74nJb3GElWUaARc&s=HRWvzSaD-Ca_MMCXA_zGvkqj73JCR9Tw9Sc7qFCpYrc&e=, or mute the thread https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AFnc9LY3YG2OYYkvazBDOZ8p3S8nl8Paks5r2JDOgaJpZM4NPFpB&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=QGd0b_06v3hDpkoxZUB9c2iQ5RMTOts_DJ98uEZzA-o&m=KHpR0ILuNJVK9DGFF-h7jV5Ij6kk74nJb3GElWUaARc&s=kRgaEV2CinquEXwLpx_znXRJ-lpHLJ6cUUHAPIaSKaU&e= .

vervacity commented 7 years ago

Hi,

Confirming the above error, I ran into this exact thing as well. I tried what Ian suggested and ran the test in a different directory and the test ran fine. Not sure what it means, but just FYI in case it helps anyone else.

ovpop100 commented 6 years ago

Hey,

I can also confirm the above error but for me it still fails independent of the running path... Any new ideas on that topic? Thanks!

wumed commented 5 years ago

Hi Dr. Bonnett,

I still met the problem on OS X, and it reports the same errors as follows,

wuMBAir:DP_GP_cluster wu$ DP_GP_cluster.py -i test/test.txt -o test/test -p png -n 20 --plot File "/Users/wuyingcheng/anaconda/bin/DP_GP_cluster.py", line 435 print "Reading sampling results." ^

Thanks!

dadrasarmin commented 1 year ago

Hi,

I tried to install and use this software and these lines do the trick. I tried it on MacOS, ubuntu, and debian.

conda create -n dpgp -c conda-forge python=2.7.15 scikit-learn=0.20.3 pandas=0.24.2 gpy=1.9.9 numpy=1.16.5  scipy=1.2.1 matplotlib=2.2.5 cython=0.29.15
conda activate dpgp

git clone https://github.com/PrincetonUniversity/DP_GP_cluster.git
cd DP_GP_cluster/
python setup.py install
DP_GP_cluster.py -i test/test.txt -o test/test -p png -n 20 --plot

If you want to run it on a server, then you have to find the python code as follows:

which DP_GP_cluster.py
vim ~/.conda/envs/YOUR_ENVIRONMENT_NAME/bin/DP_GP_cluster.py

and uncomment two lines


import matplotlib
matplotlib.use('Agg')
anke-king commented 4 months ago

I did everything exactly like you said and still get this error: running install running build running build_py running build_ext cythoning DP_GP/core.pyx to DP_GP/core.c

Error compiling Cython file:

... ''' Created on 2016-03-06

@author: Ian McDowell and ... ''' import cython ^

DP_GP/core.pyx:6:7: Compiler crash in AnalyseDeclarationsTransform

File 'ModuleNode.py', line 124, in analyse_declarations: ModuleNode(core.pyx:1:0, doc = u'\nCreated on 2016-03-06\n\n@author: Ian McDowell and ...\n') File 'Nodes.py', line 431, in analyse_declarations: StatListNode(core.pyx:6:0) File 'Nodes.py', line 431, in analyse_declarations: StatListNode(core.pyx:6:7) File 'Nodes.py', line 7931, in analyse_declarations: CImportStatNode(core.pyx:6:7, as_name = u'cython', module_name = u'cython')

Compiler crash traceback from this point on: File "/Users/ankeking/miniconda3/envs/dpgp/lib/python2.7/site-packages/Cython/Compiler/Nodes.py", line 7931, in analyse_declarations self.module_name, self.pos, relative_level=0 if self.is_absolute else -1) File "/Users/ankeking/miniconda3/envs/dpgp/lib/python2.7/site-packages/Cython/Compiler/Symtab.py", line 1270, in find_module module_name, relative_to=relative_to, pos=pos, absolute_fallback=absolute_fallback) File "/Users/ankeking/miniconda3/envs/dpgp/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 189, in find_module pxd_pathname = self.find_pxd_file(qualified_name, pos) File "/Users/ankeking/miniconda3/envs/dpgp/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 250, in find_pxd_file pxd = self.search_include_directories(qualified_name, ".pxd", pos, sys_path=sys_path) File "/Users/ankeking/miniconda3/envs/dpgp/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 296, in search_include_directories suffix, pos, include) File "/Users/ankeking/miniconda3/envs/dpgp/lib/python2.7/site-packages/Cython/Utils.py", line 40, in wrapper res = cache[args] = f(*args) File "/Users/ankeking/miniconda3/envs/dpgp/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 816, in search_include_directories path = os.path.join(dirname, dotted_filename) File "/Users/ankeking/miniconda3/envs/dpgp/lib/python2.7/posixpath.py", line 73, in join path += '/' + b UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 51: ordinal not in range(128) skipping 'DP_GP/cluster_tools.c' Cython extension (up-to-date) building 'DP_GP.core' extension gcc -fno-strict-aliasing -I/Users/ankeking/miniconda3/envs/dpgp/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ankeking/miniconda3/envs/dpgp/lib/python2.7/site-packages/numpy/core/include -I/Users/ankeking/miniconda3/envs/dpgp/include/python2.7 -c DP_GP/core.c -o build/temp.macosx-10.6-x86_64-2.7/DP_GP/core.o DP_GP/core.c:1:2: error: Do not use this file, it is the result of a failed Cython compilation.

error Do not use this file, it is the result of a failed Cython compilation.

^ 1 error generated. error: command 'gcc' failed with exit status 1

anke-king commented 4 months ago

I did install gcc via Conda and I still get the same error when running setup.py