napari: Issue with using wrong pyrcc

🐛 Bug

I updated napari to post- #1229 and napari started failing when trying to build icons on Windows after importing napari: https://github.com/napari/napari/blob/96e9722419a5b0adddbc14fe12c69a7d769f8758/napari/resources/build_icons.py#L178

Cause

This may be a non-issue for others, but became an issue for me. Basically, each of these binaries were called: 'pyrcc5.bat', 'pyrcc5', 'pyside2-rcc'

and my vanilla python virtual environment didn’t have pyrcc5.bat, but my base anaconda install was on path (bottom of list), and was the only source of pyrcc5.bat. This then failed, because it was found, but didn’t have pyqt5-sip I believe. Rearranging so that pyrcc5 was tried first fixed the issue for me.

This is a weird bug because I happened to have an Anaconda install on my path that happened to have pyrcc5.bat, and is kind of my fault. I don’t know if it makes sense for you to rearrange the binaries to try, or ensure it’s coming from the same environment. At least this is an explanation for anyone else getting a similar error:

subprocess.CalledProcessError: Command '['pyrcc5.bat', '-o', 'XXX\\lib\\site-packages\\napari\\resources\\_qt_resources_0.3.1_pyqt5_5.14.0.py', 'XXX\\lib\\site-packages\\napari\\resources\\res.qrc']' returned non-zero exit status 1.

@tlambert03

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23 (16 by maintainers)

Most upvoted comments

@tlambert03 You were right, I think python 3.7 outside conda was causing the issue. Here is what I did to fix it,

  1. Uninstalled native python through the add/remove programs interface in windows
  2. removed the native version from PATH like so
  3. Deleted the entire python folder that was in the PATH- Mine was within C:\Users\ajn16\AppData\Roaming\Python
  4. Restarted the computer.

After that,

conda create --name napari_new python=3.7
conda activate napari_new
pip install napari pyqt5

python
>>> import napari

# loads napari without any warnings. YEYY!!

Thanks for figuring this out @tlambert03 and hope it is helpful for others who find this thread 😃

Best, Ajit.

I see… if pip doesn’t see numpy>=1.10.0 from PyPI when it tries to install napari, it will likely overwrite whatever is already there. You might have better luck with conda, which is pretty good about compatibility with MKL. cheers