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

MW4_Install.command fails ImportError: cannot import name 'soft_unicode' from 'markupsafe' #229

Closed
jankansky opened this issue Mar 18, 2022 · 7 comments

Comments

@jankansky
Copy link

If I run the MW4_Install.command on Mac M1 the pip install fails during the install of astropy-4.3.1.tar.gz with the following error:

Collecting astropy==4.3.1
Downloading astropy-4.3.1.tar.gz (7.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.6/7.6 MB 32.9 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [28 lines of output]
Traceback (most recent call last):
File "/Users/jkansky/Desktop/maxmount/mount_wizard/venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in
main()
File "/Users/jkansky/Desktop/maxmount/mount_wizard/venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Users/jkansky/Desktop/maxmount/mount_wizard/venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "/private/var/folders/yq/tw57s05d61gg_vw81hdssmsm0000gn/T/pip-build-env-nsrdafxk/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
return self._get_build_requires(
File "/private/var/folders/yq/tw57s05d61gg_vw81hdssmsm0000gn/T/pip-build-env-nsrdafxk/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires
self.run_setup()
File "/private/var/folders/yq/tw57s05d61gg_vw81hdssmsm0000gn/T/pip-build-env-nsrdafxk/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 174, in run_setup
exec(compile(code, file, 'exec'), locals())
File "setup.py", line 70, in
ext_modules=get_extensions())
File "/private/var/folders/yq/tw57s05d61gg_vw81hdssmsm0000gn/T/pip-build-env-nsrdafxk/overlay/lib/python3.9/site-packages/extension_helpers/_setup_helpers.py", line 67, in get_extensions
ext_modules.extend(setuppkg.get_extensions())
File "./astropy/modeling/setup_package.py", line 59, in get_extensions
from jinja2 import Environment, FileSystemLoader
File "/private/var/folders/yq/tw57s05d61gg_vw81hdssmsm0000gn/T/pip-build-env-nsrdafxk/overlay/lib/python3.9/site-packages/jinja2/init.py", line 33, in
from jinja2.environment import Environment, Template
File "/private/var/folders/yq/tw57s05d61gg_vw81hdssmsm0000gn/T/pip-build-env-nsrdafxk/overlay/lib/python3.9/site-packages/jinja2/environment.py", line 15, in
from jinja2 import nodes
File "/private/var/folders/yq/tw57s05d61gg_vw81hdssmsm0000gn/T/pip-build-env-nsrdafxk/overlay/lib/python3.9/site-packages/jinja2/nodes.py", line 19, in
from jinja2.utils import Markup
File "/private/var/folders/yq/tw57s05d61gg_vw81hdssmsm0000gn/T/pip-build-env-nsrdafxk/overlay/lib/python3.9/site-packages/jinja2/utils.py", line 642, in
from markupsafe import Markup, escape, soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/private/var/folders/yq/tw57s05d61gg_vw81hdssmsm0000gn/T/pip-build-env-nsrdafxk/overlay/lib/python3.9/site-packages/markupsafe/init.py)
[end of output]

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

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

@jankansky
Copy link
Author

Python version is 3.9.7 running in a virtual environment on MacOS Monterey 12.2.1

Thanks for any help!

@mworion
Copy link
Owner

mworion commented Mar 18, 2022

Hi,
installing MW4 on a Mac M1 is simple, Willem-Jan made a short blog on it:
https://www.astroworldcreations.com/blog/apple-silicon-and-legacy-command-line-software
The basic start is that you need to work with Rosetta as native M1 packages for python are still rare. But He said it works flawless.
Hope this helps,
Michel

@jankansky
Copy link
Author

Thanks for the quick reply. I still get the same error message using an Intel terminal session.

I confirm that the terminal is x86_64 with uname -m

It's working in Ubuntu and Windows VMs, so I will just use that.
Jan

@orfest
Copy link

orfest commented Apr 15, 2022

Sorry for reviving this, but I get the same installation error on aarch64 Ubuntu:

Fri 20:03:23 ~/code/MountWizzard4/support/2.0/Ubuntu % cat install.log 
install script version 2.2                                                                                                                                                                                                                  
checking environment and start script     
variable P_VER has value of python3.8                                                                                                                                                                                                       
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in /home/orfest/.local/lib/python3.8/site-packages (22.0.4)                                                                                                                                              
Installing python3.8 in virtual environ                  
checking system packages, should be no mw4 in
Unknown option: -p                     
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...                                                                                                                                                                           
Try `python -h' for more information.                  
Requirement already satisfied: pip in ./venv/lib/python3.8/site-packages (22.0.4)
Requirement already satisfied: setuptools in ./venv/lib/python3.8/site-packages (62.1.0)
Requirement already satisfied: wheel in ./venv/lib/python3.8/site-packages (0.37.1)                                                                                                                                                         
Collecting mountwizzard4                                                                                              
  Downloading mountwizzard4-2.2.1.tar.gz (10.6 MB)                                                                                                                                                                                          
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.6/10.6 MB 77.4 MB/s eta 0:00:00
  Preparing metadata (setup.py): started                                                                              
  Preparing metadata (setup.py): finished with status 'done'
Collecting numpy==1.21.4                                                                                              
  Downloading numpy-1.21.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.0/13.0 MB 114.0 MB/s eta 0:00:00                                                                                                                                                           
Collecting pillow==8.3.1
  Downloading Pillow-8.3.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.9/2.9 MB 117.7 MB/s eta 0:00:00       
Collecting matplotlib==3.4.2       
  Downloading matplotlib-3.4.2-cp38-cp38-manylinux2014_aarch64.whl (9.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.0/9.0 MB 108.0 MB/s eta 0:00:00
Collecting pyerfa==2.0.0
  Downloading pyerfa-2.0.0.tar.gz (808 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 808.3/808.3 KB 62.4 MB/s eta 0:00:00
  Installing build dependencies: started                                                                              
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting astropy==4.3.1                                                                                             
  Downloading astropy-4.3.1.tar.gz (7.6 MB)                                                                           
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.6/7.6 MB 116.2 MB/s eta 0:00:00
  Installing build dependencies: started   
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error                                                                                 
   
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "/home/orfest/code/MountWizzard4/support/2.0/Ubuntu/venv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/home/orfest/code/MountWizzard4/support/2.0/Ubuntu/venv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/orfest/code/MountWizzard4/support/2.0/Ubuntu/venv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-zhb6z5a0/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
          return self._get_build_requires(
        File "/tmp/pip-build-env-zhb6z5a0/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-zhb6z5a0/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 174, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 70, in <module>
          ext_modules=get_extensions())
        File "/tmp/pip-build-env-zhb6z5a0/overlay/lib/python3.8/site-packages/extension_helpers/_setup_helpers.py", line 67, in get_extensions
          ext_modules.extend(setuppkg.get_extensions())
        File "./astropy/modeling/setup_package.py", line 59, in get_extensions
          from jinja2 import Environment, FileSystemLoader
        File "/tmp/pip-build-env-zhb6z5a0/overlay/lib/python3.8/site-packages/jinja2/__init__.py", line 33, in <module>
          from jinja2.environment import Environment, Template
        File "/tmp/pip-build-env-zhb6z5a0/overlay/lib/python3.8/site-packages/jinja2/environment.py", line 15, in <module>
          from jinja2 import nodes
        File "/tmp/pip-build-env-zhb6z5a0/overlay/lib/python3.8/site-packages/jinja2/nodes.py", line 19, in <module>
          from jinja2.utils import Markup
        File "/tmp/pip-build-env-zhb6z5a0/overlay/lib/python3.8/site-packages/jinja2/utils.py", line 642, in <module>
          from markupsafe import Markup, escape, soft_unicode
      ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/tmp/pip-build-env-zhb6z5a0/overlay/lib/python3.8/site-packages/markupsafe/__init__.py)
      [end of output]
   
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
checking venv packages, mw4 should be present
Unknown option: -p
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.
MountWizzard4 successfully installed

@mworion
Copy link
Owner

mworion commented Apr 19, 2022 via email

@orfest
Copy link

orfest commented Apr 20, 2022

Same issue with the Mate scripts
install.log

You are using a RASPI4 with Ubuntu on it?

It's aarch64 but not RASPI4

 % uname -a
Linux odroid 4.9.277-122 #1 SMP PREEMPT Mon Feb 28 14:30:14 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
% cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"

Edit: Upgrading to 22.04 now :)

@mworion
Copy link
Owner

mworion commented Apr 20, 2022

So it's aarch64 but no RASPI or something else like this. With regard to your M1 question: Do you install Ubuntu on the M1 Mac ?
The Mate script offers precompiled packages which do not fit to your system. So it has to be a different one.
You could also try to build them manually (which means automatically) if you have a C Compiler and the dev packages from python installed as well.
I see the venv installed, so please rund the
source ./venv/bin/activate
from you work dir with venv installed and manually run from there
pip install mountwizzard4
which should download the all packages and compiles them locally. Hopefully this works out. It make take some time.
Michel

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

3 participants