PDFGetX3 installed with Anaconda

710 views
Skip to first unread message

Fred marlton

unread,
Sep 7, 2017, 11:04:10 AM9/7/17
to diffpy-users
Hi Pavol,

I installad Anaconda and now I'm having trouble running PDFGetX3. I'm not sure what's going wrong as most of the installation process seems to work. When I try to run pdfgetx3 I get some errors relating to setuptools. I've attached a screenshot, could you please have a look?

Thanks,
Fred 
pdfgetx3_error.png

Pavol Juhas

unread,
Sep 7, 2017, 11:53:43 AM9/7/17
to diffpy-users
On Wed, Sep 06, 2017 at 05:37:45PM -0700, Fred marlton wrote:
...
...
> ImportError: bad magic number in 'diffpy': b'\x03\xf3\r\n'

Hi Fred,

This happens, because the diffpy.pdfgetx egg is for
Python 2.7, but it was used with Python 3.6. You have
created and activated a Python 2.7 environment "py27",
which should have avoided such mismatch. The trouble was
you ran the easy_install command from the Anaconda3\Scripts
directory, which contains "easy_install" associated with the
default Python 3.6. Windows uses a brain dead mechanism to
always look for commands in the current directory first,
therefore the egg file got installed for Python 3.6 and its
executable "pdfgetx3" ended up in the same Anaconda3\Scripts
folder. Hence, although you have switched to the "py27"
Anaconda environment, PDFgetX3 was installed (and run)
with Python 3.6.

To fix this first move away from the Scripts directory
and uninstall PDFgetX3 from the standard (Python 3.6)
"root" environment:

cd c:\Users
activate root
pip uninstall diffpy.pdfgetx

Then switch back to the "py27" environment and reinstall the egg
file. You may want to use "easy_install-2.7" to be a bit safer
from Python version confusion:

activate py27
easy_install-2.7 C:\Users\FIX\ME\diffpy.pdfgetx-1.1-py2.7.egg

Hope this helps,

Pavol

PS: All - please try to copy and paste any relevant text from
command window rather than posting its screenshot. It will
make it easier to Google for the same problem in the future.

--
Dr. Pavol Juhas
Computational Science Initiative
Brookhaven National Laboratory
P.O. Box 5000
Upton, NY 11973-5000

Fred marlton

unread,
Sep 8, 2017, 8:07:45 AM9/8/17
to diffpy-users
Hi Pavol,

Thanks for the response. 

Sorry to be a pain, but I've tried what you wrote and now I've got another bunch of errors (see below). I hope it's not just a typo on my end.....

Thanks,
Fred



(py27) C:\Users\z5029257\Anaconda3\Scripts>cd C:\Users

(py27) C:\Users>activate root

(root) C:\Users>pip uninstall diffpy.pdfgetx
Uninstalling diffpy.pdfgetx-1.1:
  c:\users\z5029257\anaconda3\lib\site-packages\diffpy.pdfgetx-1.1-py2.7.egg
  c:\users\z5029257\anaconda3\scripts\pdfgetx3-script.py
  c:\users\z5029257\anaconda3\scripts\pdfgetx3.exe
  c:\users\z5029257\anaconda3\scripts\plotdata-script.py
  c:\users\z5029257\anaconda3\scripts\plotdata.exe
Proceed (y/n)? y
  Successfully uninstalled diffpy.pdfgetx-1.1

(root) C:\Users>activate py27

(py27) C:\Users>easy_install-2.7 C:\Users\z5029257\Downloads\diffpy.pdfgetx-1.1-
py2.7.egg
Processing diffpy.pdfgetx-1.1-py2.7.egg
creating c:\users\z5029257\anaconda3\envs\py27\lib\site-packages\diffpy.pdfgetx-
1.1-py2.7.egg
Extracting diffpy.pdfgetx-1.1-py2.7.egg to c:\users\z5029257\anaconda3\envs\py27
\lib\site-packages
Adding diffpy.pdfgetx 1.1 to easy-install.pth file
Installing pdfgetx3-script.py script to C:\Users\z5029257\Anaconda3\envs\py27\Sc
ripts
Installing pdfgetx3.exe script to C:\Users\z5029257\Anaconda3\envs\py27\Scripts
Installing plotdata-script.py script to C:\Users\z5029257\Anaconda3\envs\py27\Sc
ripts
Installing plotdata.exe script to C:\Users\z5029257\Anaconda3\envs\py27\Scripts

Installed c:\users\z5029257\anaconda3\envs\py27\lib\site-packages\diffpy.pdfgetx
-1.1-py2.7.egg
Processing dependencies for diffpy.pdfgetx==1.1
Finished processing dependencies for diffpy.pdfgetx==1.1

(py27) C:\Users>pdfgetx3
Traceback (most recent call last):
  File "C:\Users\z5029257\Anaconda3\envs\py27\Scripts\pdfgetx3-script.py", line
11, in <module>
    load_entry_point('diffpy.pdfgetx==1.1', 'console_scripts', 'pdfgetx3')()
  File "C:\Users\z5029257\Anaconda3\envs\py27\lib\site-packages\pkg_resources\__
init__.py", line 570, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "C:\Users\z5029257\Anaconda3\envs\py27\lib\site-packages\pkg_resources\__
init__.py", line 2687, in load_entry_point
    return ep.load()
  File "C:\Users\z5029257\Anaconda3\envs\py27\lib\site-packages\pkg_resources\__
init__.py", line 2341, in load
    return self.resolve()
  File "C:\Users\z5029257\Anaconda3\envs\py27\lib\site-packages\pkg_resources\__
init__.py", line 2347, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "build/bdist.macosx-10.10-x86_64/egg/diffpy/pdfgetx/pdfgetxapplication.py
", line 23, in <module>
ImportError: No module named numpy

Pavol Juhas

unread,
Sep 8, 2017, 11:23:31 AM9/8/17
to diffpy...@googlegroups.com
On Fri, Sep 08, 2017 at 05:07:45AM -0700, Fred marlton wrote:
...
> Sorry to be a pain, but I've tried what you wrote and now I've got another
> bunch of errors (see below). I hope it's not just a typo on my end.....
...
> (py27) C:\Users>pdfgetx3
...
> ImportError: No module named numpy

Hi Fred,

You need to install the "numpy" package into your py27 environment.
The default "root" environment in Anaconda 3 has all science
packages pre-installed, but any new environment has only packages
given on its "conda create ..." command. To install
numpy and other packages required for PDFgetX3 use

activate py27
conda install numpy matplotlib ipython

BTW, the manual
(http://www.diffpy.org/doc/pdfgetx3/install.html#software-requirements)
also asks for "setuptools" and "PyReadline", but setuptools are
always installed by conda and "pyreadline" would get installed
automatically if needed for ipython.

Hope this works,

Pavol

Fred marlton

unread,
Sep 10, 2017, 8:44:25 PM9/10/17
to diffpy-users
Hi Pavol,

Thanks for all the hep. It's working now :)
Reply all
Reply to author
Forward
0 new messages