PDFgetX3 error for Ni X-ray PDF example

445 views
Skip to first unread message

Chung-Yul Yoo

unread,
Aug 28, 2017, 11:09:50 AM8/28/17
to diffpy-users
Dear all,

I have installed PDFgetX3 and tried Ni X-ray PDF example.

I have checked that I have installed PDFgetX3 properly.

When I run "plotdata ni300mesh_300k_nor_1-5.gr", I have found error as given below.

Could you help me to solve this problem?

Thank you for your help in advance.

Best regards,
Chung-Yul

--------------------------------------------------------------------------------------------------------------------------- Error message

C:\Anaconda\lib\site-packages\IPython\config.py:13: ShimWarning: The `IPython.co
nfig` package has been deprecated. You should import from traitlets.config inste
ad.
  "You should import from traitlets.config instead.", ShimWarning)
Traceback (most recent call last):
  File "C:\Anaconda\Scripts\plotdata-script.py", line 11, in <module>
    load_entry_point('diffpy.pdfgetx==1.1', 'console_scripts', 'plotdata')()
  File "build/bdist.macosx-10.10-x86_64/egg/diffpy/pdfgetx/plotdata.py", line 10
1, in main
  File "build/bdist.macosx-10.10-x86_64/egg/diffpy/pdfgetx/interaction.py", line
 32, in createIPythonInterface
  File "build/bdist.macosx-10.10-x86_64/egg/diffpy/pdfgetx/interaction.py", line
 186, in __init__
  File "<string>", line 2, in initialize
  File "C:\Anaconda\lib\site-packages\traitlets\config\application.py", line 87,
 in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Anaconda\lib\site-packages\IPython\terminal\ipapp.py", line 305, in i
nitialize
    self.init_shell()
  File "C:\Anaconda\lib\site-packages\IPython\terminal\ipapp.py", line 321, in i
nit_shell
    ipython_dir=self.ipython_dir, user_ns=self.user_ns)
  File "C:\Anaconda\lib\site-packages\traitlets\config\configurable.py", line 41
2, in instance
    inst = cls(*args, **kwargs)
  File "C:\Anaconda\lib\site-packages\IPython\core\interactiveshell.py", line 48
3, in __init__
    self.init_readline()
  File "C:\Anaconda\lib\site-packages\IPython\terminal\interactiveshell.py", lin
e 362, in init_readline
    import IPython.utils.rlineimpl as readline
  File "C:\Anaconda\lib\site-packages\IPython\utils\rlineimpl.py", line 21, in <
module>
    _rl = __import__(_rlmod_name)
  File "C:\Anaconda\lib\site-packages\readline.py", line 34, in <module>
    rl = Readline()
  File "C:\Anaconda\lib\site-packages\pyreadline\rlmain.py", line 423, in __init
__
    self.console = console.Console()
  File "C:\Anaconda\lib\site-packages\pyreadline\console\console.py", line 221,
in __init__
    CDLL('python%s%s' % (sys.version[0], sys.version[2]))
  File "C:\Anaconda\lib\ctypes\__init__.py", line 362, in __init__
    self._handle = _dlopen(self._name, mode)
TypeError: LoadLibrary() argument 1 must be string, not unicode

If you suspect this is an IPython bug, please report it at:
or send an email to the mailing list at ipyth...@scipy.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    c.Application.verbose_crash=True

Pavol Juhas

unread,
Aug 28, 2017, 11:50:12 AM8/28/17
to diffpy...@googlegroups.com
On Sat, Aug 26, 2017 at 04:47:29AM -0700, Chung-Yul Yoo wrote:
...
> When I run "plotdata ni300mesh_300k_nor_1-5.gr", I have found error as
> given below.
...
> File "C:\Anaconda\lib\ctypes\__init__.py", line 362, in __init__
> self._handle = _dlopen(self._name, mode)
> TypeError: LoadLibrary() argument 1 must be string, not unicode

Hi Chung-Yul,

This appears to be a bug in Python 2.7.13, see discussion of a similar
problem at https://github.com/rg3/youtube-dl/issues/11540. The bug
should be fixed in Python 2.7.14 which should be released within
a month or so - https://www.python.org/dev/peps/pep-0373/#release-schedule.

For now the solution is to downgrade Anaconda Python to
version 2.7.12 by running

conda install python=2.7.12

This is however a bit fragile, because any package installation may
revert Python back to its latest version 2.7.13. A more robust
method is to create a pinning rule that prohibits version 2.7.13,
i.e., by adding the following line to the
C:/Anaconda/conda-meta/pinned file:

python !=2.7.13

After editing the "pinned" file, run "conda update python"
so that the pinning rule gets applied (and Python downgraded).
For full details see
https://conda.io/docs/user-guide/tasks/manage-pkgs.html#preventing-packages-from-updating-pinning.

I hope this works. Please reply to the mailing list to let us
know if this indeed helped with the problem. Thank you,

Pavol

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

Fred marlton

unread,
Sep 11, 2017, 8:23:20 PM9/11/17
to diffpy-users
Hi Pavol,

Hope I'm not wasting your time, but I've been having similar issues to this. The following errors have occurred. The first command still produces the G(r) plot, but the second one doesn't produce anything. I tried downgrading my python version to 2.7.12, but it didn't make a difference, so I'm assuming I'm missing something else. 

Thanks,
Fred 

(py27) C:\Users\z5029257\Anaconda3\envs\py27\Lib\site-packages\diffpy.pdfgetx-1.
1-py2.7.egg\doc\examples\Ni>plotdata ni300mesh_300k_nor_1-5.gr
C:\Users\z5029257\Anaconda3\envs\py27\lib\site-packages\IPython\config.py:13: Sh
imWarning: The `IPython.config` package has been deprecated since IPython 4.0. Y
ou should import from traitlets.config instead.
  "You should import from traitlets.config instead.", ShimWarning)
Using matplotlib backend: Qt5Agg 


(py27) C:\Users\z5029257\Anaconda3\envs\py27\Lib\site-packages\diffpy.pdfgetx-1.
1-py2.7.egg\doc\examples\Ni>pdfgetx3 -c ni300mesh_300k_nor_1-5.gr --plot=gr
C:\Users\z5029257\Anaconda3\envs\py27\lib\site-packages\IPython\config.py:13: Sh
imWarning: The `IPython.config` package has been deprecated since IPython 4.0. Y
ou should import from traitlets.config instead.
  "You should import from traitlets.config instead.", ShimWarning)
Using matplotlib backend: Qt5Agg
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 "build/bdist.macosx-10.10-x86_64/egg/diffpy/pdfgetx/pdfgetxapplication.py
", line 424, in main
  File "build/bdist.macosx-10.10-x86_64/egg/diffpy/pdfgetx/pdfgetxapplication.py
", line 72, in run
  File "build/bdist.macosx-10.10-x86_64/egg/diffpy/pdfgetx/pdfgetxapplication.py
", line 293, in _interactionPrepare
  File "build/bdist.macosx-10.10-x86_64/egg/diffpy/pdfgetx/ipy_pdfgetx3.py", lin
e 52, in load_ipython_extension
AttributeError: 'TerminalInteractiveShell' object has no attribute 'define_magic
'

If you suspect this is an IPython bug, please report it at:
or send an email to the mailing list at ipyth...@scipy.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

Pavol Juhas

unread,
Sep 12, 2017, 3:47:58 PM9/12/17
to diffpy...@googlegroups.com
On Tue, Sep 12, 2017 at 12:23:20AM +0000, Fred marlton wrote:
> Hi Pavol,
>
> Hope I'm not wasting your time, but I've been having similar issues to
> this. The following errors have occurred. The first command still produces
> the G(r) plot, but the second one doesn't produce anything. I tried
> downgrading my python version to 2.7.12, but it didn't make a difference,
> so I'm assuming I'm missing something else.
...
> (py27)
> ...\doc\examples\Ni>pdfgetx3 -c ni300mesh_300k_nor_1-5.gr --plot=gr
...
> File "build/bdist.macosx-10.10-x86_64/egg/diffpy/pdfgetx/ipy_pdfgetx3.py", line 52, in load_ipython_extension
> AttributeError: 'TerminalInteractiveShell' object has no attribute 'define_magic'

Hi Fred,

This is a bit different error - PDFgetX3 version 1.1 does not work
with IPython 5, because IPython developers made incompatible changes
to their public functions. I am working on a new release that will
fix that. In the meantime you can downgrade to IPython 4 using

conda install "ipython=4"

Hope this works and sorry about the inconvenience,

Fred marlton

unread,
Sep 13, 2017, 12:23:17 AM9/13/17
to diffpy-users
Awesome, thanks Pavol

Sourabh Wajhal

unread,
Feb 6, 2018, 12:17:18 AM2/6/18
to diffpy-users
Hello All,

I am also facing the same problem as Chung-Yui Yoo mentioned above. I have installed python 2.7.14 version in Anaconda but the same error persists. Any help will be much appreciated.

-Sourabh Wajhal

Pavol Juhas

unread,
Feb 6, 2018, 12:18:22 PM2/6/18
to diffpy-users
On Mon, Feb 05, 2018 at 09:17:18PM -0800, Sourabh Wajhal wrote:
> Hello All,
>
> I am also facing the same problem as Chung-Yui Yoo mentioned above. I have
> installed python 2.7.14 version in Anaconda but the same error persists.
> Any help will be much appreciated.

Hi Sourabh,

I don't see this on a 64-bit Anaconda for Windows. The plotdata
program works for me as expected. Here is a list of relevant
packages in my installation:

$ conda list -f "(i?python|matplotlib|numpy)"
# packages in environment at C:\Users\pjuhas\AppData\Local\Continuum\Anaconda\en
vs\x27:
#
ipython 5.4.1 py27_2
matplotlib 2.1.2 py27ha51faf0_0
numpy 1.14.0 py27hfef472a_1
python 2.7.14 h8c3f1cb_23

The problem might be related to regional settings (Control Panel -->
Region and Language). If you use them, please try to switch
to an English locale. Another possibility is the bug appears
if there are some international characters in installation path.
Do you see any such characters in the output from "conda info" ?

The final option is to reinstall with Python 3.6. The recent
PDFgetX3 release 1.2 works with Python 2.7 and with 3.4 or later.
Here is how to create an Anaconda environment with Python 3.6
and use it to install PDFgetX3:

conda create -n py36 python=3.6 numpy matplotlib
conda activate py36
python -m easy_install c:/path/to/diffpy.pdfgetx-1.2.egg

Hope this helps,

Pavol

PS: Please post to the list if any of the suggestions work.

--
Dr. Pavol Juhas
Computational Science Initiative
Brookhaven National Laboratory
P.O. Box 5000
Upton, NY 11973-5000
tel: +1-631-344-3594
fax: +1-631-344-5751

Sourabh Wajhal

unread,
Feb 7, 2018, 6:55:49 AM2/7/18
to diffpy-users
Dear Juhas,

I have 64-bit Windows system and I have tried following options:
1) Updated my ipython, matplotlib and numpy to same version as yours. In this thing, matplotlib has some problem related to backports.functools_lru_cache.
2) Installed latest version of Anaconda2, which has ipython 5.4.1, matplotlib 2.1.0 and numpy 1.13.3. Still I am facing the same problem. Here, I didnt try to upgrade matplotlib as it comes with other difficulties.
3) Also installed Anaconda3 and requested for pdfgetx3 1.2 version egg file. As soon as my request gets approval, i will try to run pdfgetx3 on Anaconda3.

Thanks for your response.

Regards,
Sourabh

On Monday, August 28, 2017 at 8:39:50 PM UTC+5:30, Chung-Yul Yoo wrote:

Sourabh Wajhal

unread,
Feb 8, 2018, 12:19:21 AM2/8/18
to diffpy-users
Dear Pavol Juhas,

Thanks for your suggestion.

I downloaded pdfgetx-1.2.egg file and installed it using easy_install. And it is working fine.

Regards,
Sourabh Wajhal


On Monday, August 28, 2017 at 8:39:50 PM UTC+5:30, Chung-Yul Yoo wrote:
Reply all
Reply to author
Forward
0 new messages