dkriegner / xrayutilities

xrayutilities - a package with useful scripts for X-ray diffraction physicists
http://xrayutilities.sourceforge.io
GNU General Public License v2.0
81 stars 29 forks source link

cannot import cxrayutilities #75

Closed Jon2515 closed 5 years ago

Jon2515 commented 5 years ago

I have a mac OS, I am using anaconda and spyder IDE. I am trying to run sample code. I run import xrayutilities as xu. Several things import then I get an error, it says:

anaconda/pkgs/xrayutilities/io/cbf.py", line 25, in from .. import config, cxrayutilities

ImportError: cannot import name 'cxrayutilities'

So, does anyone know why this is happening, and how to get around it?

Thanks for the help!

dkriegner commented 5 years ago

could you describe how you installed xrayutilities?

this error usually indicates that the installation process was not completed successfully. Especially the compiling of the included c-library! Please refer to the README and/or documentation for information regarding the installation.

Jon2515 commented 5 years ago

From the Mac Terminal. Initially, I did pip install xrayutilities. It gave errors and said it wasn't installed when I tried to import xrayutilities into a program. I then did pip install --global-option="--without-openmp" xrayutilities this time it installed and said it was successful. When I import it to a program and run it I get the message described initially.

dkriegner commented 5 years ago

could you please provide the following to help me better understand what could have gone wrong...

remove xrayutilities for example by pip uninstall xrayutilities and post/upload the output of pip -v install --force --global-option="--without-openmp" xrayutilities

Jon2515 commented 5 years ago

It has been resolved. Thank you for your assistance.

My issue was: I had downloaded the package, then moved it into the directory for python packages, then I did pip install. I didn't realize when one does pip install it automatically goes to the internet and downloads it and installs it.

dkriegner commented 5 years ago

thanks for the feedback which hopefully helps people in the same situation!