Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

installation error #8

Closed
MohammadSalehi72 opened this issue May 11, 2020 · 7 comments
Closed

installation error #8

MohammadSalehi72 opened this issue May 11, 2020 · 7 comments

Comments

@MohammadSalehi72
Copy link

Hi Dan
I tried to install DVHA-DICOM-Editor with pip but got an error :
"Traceback (most recent call last):
File "C:\Python\lib\site-packages\dvhaedit\main.py", line 954, in OnInit
self.frame = MainFrame(None, wx.ID_ANY, "DVHA DICOM Editor v%s" % version)
File "C:\Python\lib\site-packages\dvhaedit\main.py", line 100, in init
self.__do_layout()
File "C:\Python\lib\site-packages\dvhaedit\main.py", line 235, in __do_layout
row_sizer.Add(self.force_open, 0, wx.ALIGN_RIGHT | wx.RIGHT, 15)
wx._core.wxAssertionError: C++ assertion "!(flags & wxALIGN_RIGHT)" failed at ....\src\common\sizer.cpp(2098) in wxBoxSizer::DoInsert(): Horizontal alignment flags are ignored in horizontal sizers OnInit returned false, exiting... "
I also cloned and again get this error.

OS: Win10
Python :3.7

@cutright
Copy link
Owner

This is interesting. Although I don't need wx.ALIGN_RIGHT on line 235, that doesn't crash on my work PC with Windows7.

Which version of wxPython are you using? I'm on 4.0.7.post2:
pip show wxpython

I created a v0.7.1.dev branch with this change. You could clone the new branch from here:
https://github.com/cutright/DVHA-DICOM-Editor/tree/v0.7.1dev

But it might be much easier to just edit main.py for a temporary fix. If it resolves your error, I'll push a new release to the master branch and pip.

Change dvhaedit/main.py Line 235 from:
row_sizer.Add(self.force_open, 0, wx.ALIGN_RIGHT | wx.RIGHT, 15)
to
row_sizer.Add(self.force_open, 0, wx.RIGHT, 15)

@MohammadSalehi72
Copy link
Author

This is a summary of wxpython installed on my windows:
Name: wxPython
Version: 4.1.0
Summary: Cross platform GUI toolkit for Python, "Phoenix" version
Home-page: http://wxPython.org/
Author: Robin Dunn
Author-email: robin@alldunn.com
License: wxWindows Library License (https://opensource.org/licenses/wxwindows.php)
Location: c:\python\lib\site-packages
Requires: numpy, pillow, six
Required-by: dvha-edit
Also, I changed the line 235 as you said, but still there is an previous error.

@cutright
Copy link
Owner

I get the same error on macOS when I upgrade wxPython to 4.1.0.

(venv2) Ninjas-MacBook-Pro:DVHA-DICOM-Editor ninja$ python dvhaedit_app.py
Traceback (most recent call last):
  File "/Users/ninja/PycharmProjects/DVHA-DICOM-Editor/dvhaedit/main.py", line 954, in OnInit
    self.frame = MainFrame(None, wx.ID_ANY, "DVHA DICOM Editor v%s" % __version__)
  File "/Users/ninja/PycharmProjects/DVHA-DICOM-Editor/dvhaedit/main.py", line 100, in __init__
    self.__do_layout()
  File "/Users/ninja/PycharmProjects/DVHA-DICOM-Editor/dvhaedit/main.py", line 236, in __do_layout
    row_sizer.Add(self.search_sub_folders, 0, wx.ALIGN_RIGHT, 0)
wx._core.wxAssertionError: C++ assertion "!(flags & wxALIGN_RIGHT)" failed at /Users/robind/projects/bb2/dist-osx-py36/build/ext/wxWidgets/src/common/sizer.cpp(2098) in DoInsert(): Horizontal alignment flags are ignored in horizontal sizers
OnInit returned false, exiting...

I'll see if I can figure out the issue, but I'll put a cap on the wxpython version in the meantime.

@MohammadSalehi72
Copy link
Author

Thank you very much.
I downgrade Wxpython version from 4.1.0 to 4.0.7.post2 via " pip install wxPython== 4.0.7.post2" and works for me.

Best Regards

@cutright
Copy link
Owner

I just pushed v0.7.post1 to PyPI with:

wxPython>=4.0.4,<4.1.0

I found this issue posted on wxPython's issue page.

@MohammadSalehi72
Copy link
Author

That's great
Thanks for your consistency

@cutright
Copy link
Owner

No problem, thank you for sharing.

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

No branches or pull requests

2 participants