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

UnicodeDecodeError during pip install #3

Open
jimy-byerley opened this issue Feb 14, 2023 · 6 comments
Open

UnicodeDecodeError during pip install #3

jimy-byerley opened this issue Feb 14, 2023 · 6 comments

Comments

@jimy-byerley
Copy link
Owner

from @wociety

Hello.
I'm a newbie. Thanks for providing such a wonderful library. I would like to try pymadcad.
However, when trying to install pymadcad using pip in a Windows environment, the following error occurs.

Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:\Users\wocie\AppData\Local\Temp\pip-install-4_jccb79\arrex_a51c1d5dec5b445daf2e2749254cc72c\setup.py", line 40, in
long_description = open('README.md').read(),
^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 3861: illegal multibyte sequence
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

I guess this is an error reading the readme file. Is there any good way to solve this problem?

@jimy-byerley
Copy link
Owner Author

So this is due to two minor facts:

  • there is non-utf-8 invusible characters in the README, I removed them
  • the text file default encoding in python is dependent on the OS locale settings
    on your OS that was surely ascii or whatever that do not support the same range of characters. To prevent this issue I forced utf-8 encoding for the readme.

Can you try to install the package from source (this repository) so we can check there is nothing more weird before I release the fix ?

# download the source (git clone, or download a zip file)
# then from the source folder:
pip install cython
python setup.py install

@wociety
Copy link

wociety commented Feb 15, 2023

Hello, I think this thread should move to "pymadcad" not here(arrex).

I tried as you commended : python setup.py install
the installation was successful, but I still get error when I try importing madcad.
Hope you could give me some advice. : )

`C:\Python310\Manual_install\pymadcad-master>python
Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import madcad
Traceback (most recent call last):
File "", line 1, in
File "C:\Python310\Manual_install\pymadcad-master\madcad_init_.py", line 135, in
from . import (
File "C:\Python310\Manual_install\pymadcad-master\madcad\mesh_init_.py", line 71, in
from .mesh import Mesh, mkquad, mktri
File "C:\Python310\Manual_install\pymadcad-master\madcad\mesh\mesh.py", line 1, in
from .container import *
File "C:\Python310\Manual_install\pymadcad-master\madcad\mesh\container.py", line 14, in
from .. import hashing
File "C:\Python310\Manual_install\pymadcad-master\madcad\hashing.py", line 9, in
from . import core
ImportError: cannot import name 'core' from partially initialized module 'madcad' (most likely due to a circular import) (C:\Python310\Manual_install\pymadcad-master\madcad_init_.py)`

@jimy-byerley
Copy link
Owner Author

If this is working for arrex, this issue is then resolved :)
But It seems an other one occur for madcad

Can you send also the terminal output of the installation of madcad, in your attempt it seems the installation did not compiled madcad.core

@wociety
Copy link

wociety commented Feb 18, 2023

Sure.
The last sentence means : The specified module could not be found.

C:\Python310>python
Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import madcad
Traceback (most recent call last):
File "", line 1, in
File "C:\Python310\lib\site-packages\pymadcad-0.15.1-py3.10-win-amd64.egg\madcad_init_.py", line 135, in
from . import (
File "C:\Python310\lib\site-packages\pymadcad-0.15.1-py3.10-win-amd64.egg\madcad\generation.py", line 8, in
from .primitives import Axis
File "C:\Python310\lib\site-packages\pymadcad-0.15.1-py3.10-win-amd64.egg\madcad\primitives.py", line 44, in
from . import displays
File "C:\Python310\lib\site-packages\pymadcad-0.15.1-py3.10-win-amd64.egg\madcad\displays.py", line 6, in
from .rendering import Display, overrides, writeproperty
File "C:\Python310\lib\site-packages\pymadcad-0.15.1-py3.10-win-amd64.egg\madcad\rendering.py", line 52, in
from PyQt5.QtCore import Qt, QPoint, QEvent
ImportError: DLL load failed while importing QtCore: 지정된 모듈을 찾을 수 없습니다.

@jimy-byerley
Copy link
Owner Author

Thanks, but this is the output when you try to import madcad, not the output when you install it.

can you copy paste the output of the following ?

pip uninstall pymadcad
pip install pymadcad

Also when you copy paste some code or log on this forum, don't forget to add the mardown code delimiters (```) to allow proper reading of the code

Your last log shows a different error than the previous one:

ImportError: DLL load failed while importing QtCore: 지정된 모듈을 찾을 수 없습니다.

Did yoou changed something in between ?

@wociety
Copy link

wociety commented Feb 22, 2023

Sorry for my misunderstanding.
This is the full log of installation and I did not change anything.

C:\Users\wocie>pip uninstall pymadcad
Found existing installation: pymadcad 0.15.1
Uninstalling pymadcad-0.15.1:
  Would remove:
    c:\python310\lib\site-packages\pymadcad-0.15.1-py3.10-win-amd64.egg
Proceed (Y/n)? y
  Successfully uninstalled pymadcad-0.15.1

C:\Users\wocie>pip install pymadcad
Collecting pymadcad
  Using cached pymadcad-0.15.1.tar.gz (1.4 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pyglm>=2.5.5 in c:\python310\lib\site-packages\pyglm-2.7.0-py3.10-win-amd64.egg (from pymadcad) (2.7.0)
Requirement already satisfied: moderngl>=5.6 in c:\python310\lib\site-packages\moderngl-6.0.dev0-py3.10-win-amd64.egg (from pymadcad) (6.0.dev0)
Requirement already satisfied: numpy>=1.1 in c:\python310\lib\site-packages (from pymadcad) (1.24.2)
Requirement already satisfied: scipy>=1.3 in c:\python310\lib\site-packages (from pymadcad) (1.10.0)
Requirement already satisfied: PyQt5>=5 in c:\python310\lib\site-packages\pyqt5-5.15.9-py3.10-win-amd64.egg (from pymadcad) (5.15.9)
Requirement already satisfied: Pillow>=5.4 in c:\python310\lib\site-packages (from pymadcad) (9.4.0)
Requirement already satisfied: pyyaml>=5 in c:\python310\lib\site-packages\pyyaml-6.0-py3.10-win-amd64.egg (from pymadcad) (6.0)
Requirement already satisfied: arrex>=0.5.1 in c:\python310\lib\site-packages\arrex-0.5.1-py3.10-win-amd64.egg (from pymadcad) (0.5.1)
Requirement already satisfied: PyQt5-sip<13,>=12.11 in c:\python310\lib\site-packages\pyqt5_sip-12.11.1-py3.10-win-amd64.egg (from PyQt5>=5->pymadcad) (12.11.1)
Requirement already satisfied: PyQt5-Qt5>=5.15.2 in c:\python310\lib\site-packages\pyqt5_qt5-5.15.2-py3.10-win-amd64.egg (from PyQt5>=5->pymadcad) (5.15.2)
Installing collected packages: pymadcad
  DEPRECATION: pymadcad is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for pymadcad ... done
Successfully installed pymadcad-0.15.1

C:\Users\wocie>python
Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymadcad
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pymadcad'
>>> import madcad
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python310\lib\site-packages\madcad\__init__.py", line 135, in <module>
    from . import (
  File "C:\Python310\lib\site-packages\madcad\generation.py", line 8, in <module>
    from .primitives import Axis
  File "C:\Python310\lib\site-packages\madcad\primitives.py", line 44, in <module>
    from . import displays
  File "C:\Python310\lib\site-packages\madcad\displays.py", line 6, in <module>
    from .rendering import Display, overrides, writeproperty
  File "C:\Python310\lib\site-packages\madcad\rendering.py", line 52, in <module>
    from PyQt5.QtCore import Qt, QPoint, QEvent
ImportError: DLL load failed while importing QtCore: 지정된 모듈을 찾을 수 없습니다.

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