Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdfgui "no module named 'wx' error" for pip installed diffpy.pdfgui==3.1.0rc4 (Apple M1) #200

Open
bobleesj opened this issue Aug 24, 2024 · 3 comments

Comments

@bobleesj
Copy link

As instructed by @sbillinge, I tried the following steps:

> conda deactivate
> mamba create -n pdfgui-test311 python=3.11 
> conda activate pdfgui-test311
> pip install diffpy.pdfgui==3.1.0rc4
> pdfgui

Pip installation works. But, I get the following error when I type pdfgui

imac@imacs-iMac ~ % pdfgui                                   
Traceback (most recent call last):
  File "/Users/imac/miniconda3/envs/pdfgui-test312/bin/pdfgui", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/imac/miniconda3/envs/pdfgui-test312/lib/python3.12/site-packages/diffpy/pdfgui/applications/pdfgui.py", line 118, in main
    import diffpy.pdfgui.gui.main as guimain
  File "/Users/imac/miniconda3/envs/pdfgui-test312/lib/python3.12/site-packages/diffpy/pdfgui/gui/main.py", line 19, in <module>
    import wx
ModuleNotFoundError: No module named 'wx'

I checked that the regular installation procedure worked:

CONDA_SUBDIR=osx-64 conda create -n pdfgui39 python=3.9
conda activate  pdfgui39
conda config --env --set subdir osx-64
conda install -c conda-forge diffpy.pdfgui
pdfgui
@Tieqiong
Copy link
Contributor

@bobleesj Thanks. When you pip install the package you would also like to install all the requirements. This is not necessary when installing from Conda-forge because it will automatically install everything for you. In this case wx means the wxpython package which is one of the requirements.
A good way to install requirements easily is to cd to the package dir then run Conda install --file requirements/run.txt (depend on what you want to do you might also want to install test.txt or build.txt).
I guess you want to test running pdfgui with the latest pdffit2==1.4.4rc1. So after installing all of the requirements you then (or before installing requirements) uninstall the original pdffit2 you get from Conda-forge and then do the pip install. After this run Conda list to check if everything is correct.

@bobleesj
Copy link
Author

bobleesj commented Aug 25, 2024

@Tieqiong Thanks for the answer. I cloned the latest main branch from diffpy.pdfgui and then ran Conda install --file requirements/run.txt

I get the following dependency error fonttools >=4.22.0 for Python 3.12 (M1).

LibMambaUnsatisfiableError: Encountered problems while solving:
  - package matplotlib-base-2.1.2-py27h31f9439_1 requires python >=2.7,<2.8.0a0, but none of the providers can be installed

Could not solve for environment specs
The following packages are incompatible
├─ matplotlib-base is installable with the potential options
│  ├─ matplotlib-base [2.1.2|2.2.3|2.2.4|2.2.5] would require
│  │  └─ python >=2.7,<2.8.0a0 , which can be installed;
│  ├─ matplotlib-base [2.1.2|2.2.3|...|3.3.4] would require
│  │  └─ python >=3.6,<3.7.0a0 , which can be installed;
│  ├─ matplotlib-base [2.1.2|2.2.3|...|3.4.3] would require
│  │  └─ python >=3.7,<3.8.0a0 , which can be installed;
│  ├─ matplotlib-base [2.2.4|2.2.5|...|3.4.3] would require
│  │  └─ python >=3.8,<3.9.0a0 , which can be installed;
│  ├─ matplotlib-base [2.2.5|3.3.2|...|3.4.3] would require
│  │  └─ python >=3.9,<3.10.0a0 , which can be installed;
│  ├─ matplotlib-base 3.4.3 would require
│  │  └─ python >=3.10,<3.11.0a0 , which can be installed;
│  └─ matplotlib-base [3.5.0|3.5.1|...|3.9.2] would require
│     └─ fonttools >=4.22.0 , which conflicts with any installable versions previously reported;
└─ pin-1 is not installable because it requires
   └─ python 3.12.* , which conflicts with any installable versions previously reported.

Pins seem to be involved in the conflict. Currently pinned specs:
 - python 3.12.* (labeled as 'pin-1')
``

@Tieqiong
Copy link
Contributor

Tieqiong commented Aug 26, 2024

@bobleesj This is very strange, as on my Mac it install fonttools == 4.53.1 for me. Maybe try uninstall it and then install? It could be that you had a older version installed somewhere before?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants