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

[Install error] cannot import name 'soft_unicode' from 'markupsafe' #16

Closed
andrevitorelli opened this issue May 10, 2022 · 7 comments
Closed

Comments

@andrevitorelli
Copy link

On candide, I'm trying to install mccd on the shapepipe environment. I get the following otuput:

(shapepipe) [<username>@c03 ~/github]$ pip pip install mccd
Collecting mccd
  Using cached mccd-1.1.1-py3-none-any.whl (74 kB)
Collecting modopt==1.5.1
  Using cached modopt-1.5.1-py3-none-any.whl (59 kB)
Requirement already satisfied: scipy>=1.5.4 in /home/<username>/.conda/envs/shapepipe/lib/python3.9/site-packages (from mccd) (1.8.0)
Requirement already satisfied: numpy>=1.19.5 in /home/<username>/.conda/envs/shapepipe/lib/python3.9/site-packages (from mccd) (1.22.3)
Collecting python-pysap==0.0.5
  Using cached python-pySAP-0.0.5.tar.gz (656 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: astropy>=4.0.2 in /home/<username>/.conda/envs/shapepipe/lib/python3.9/site-packages (from mccd) (5.0)
Collecting scipy>=1.5.4
  Downloading scipy-1.5.4-cp39-cp39-manylinux1_x86_64.whl (25.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 25.8/25.8 MB 22.1 MB/s eta 0:00:00
Collecting importlib-metadata==3.7.0
  Using cached importlib_metadata-3.7.0-py3-none-any.whl (11 kB)
Collecting numpy>=1.19.5
  Downloading numpy-1.19.5-cp39-cp39-manylinux2010_x86_64.whl (14.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.9/14.9 MB 23.8 MB/s eta 0:00:00
Collecting progressbar2==3.53.1
  Using cached progressbar2-3.53.1-py2.py3-none-any.whl (25 kB)
Collecting matplotlib==3.3.4
  Downloading matplotlib-3.3.4-cp39-cp39-manylinux1_x86_64.whl (11.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.5/11.5 MB 26.7 MB/s eta 0:00:00
Collecting astropy>=4.0.2
  Downloading astropy-4.1.tar.gz (7.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.8/7.8 MB 24.3 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 "/home/<username>/.conda/envs/shapepipe/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/home/<username>/.conda/envs/shapepipe/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 "/home/<username>/.conda/envs/shapepipe/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 "/tmp/pip-build-env-uvwtpde6/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
          return self._get_build_requires(
        File "/tmp/pip-build-env-uvwtpde6/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-uvwtpde6/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 <module>
          ext_modules=get_extensions())
        File "/tmp/pip-build-env-uvwtpde6/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 "/tmp/pip-build-env-uvwtpde6/overlay/lib/python3.9/site-packages/jinja2/__init__.py", line 33, in <module>
          from jinja2.environment import Environment, Template
        File "/tmp/pip-build-env-uvwtpde6/overlay/lib/python3.9/site-packages/jinja2/environment.py", line 15, in <module>
          from jinja2 import nodes
        File "/tmp/pip-build-env-uvwtpde6/overlay/lib/python3.9/site-packages/jinja2/nodes.py", line 19, in <module>
          from jinja2.utils import Markup
        File "/tmp/pip-build-env-uvwtpde6/overlay/lib/python3.9/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-uvwtpde6/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.

Any suggestions?

@tobias-liaudat
Copy link
Member

Oh I've never seen that error before.

@andrevitorelli Could you list which modules you have load in candide before installing mccd?

Could you also confirm where you are installing it? I mean, you are trying to install it in the conda environment generated by shapepipe? Normally, mccd is installed by default in the shapepipe conda environment.

I also see that you are trying to install the version 1.1.1 of mccd, but the current version is 1.2.3. Is there a specific reason for that?

@andrevitorelli
Copy link
Author

Could you also confirm where you are installing it?

Inside the shapepipe environment on candide

you are trying to install it in the conda environment generated by shapepipe?

Yes

I also see that you are trying to install the version 1.1.1 of mccd, but the current version is 1.2.3. Is there a specific reason for that?

So, I noticed that after installing ShapePipe, mccd wasn't installed and I couldn't find any error message. (but the ShapePipe installer displays it as not installed at the end). I then pip install mccd --user it, and didn't choose version, so there is no specific reason for that.

@tobias-liaudat
Copy link
Member

Ok you can try using the version specified in shapepipe's environment.yml file. You can do pip install mccd==1.2.3, as you are already inside the conda environment I think there's no need for the user flag.

@martinkilbinger
Copy link

Hi @andrevitorelli we had problems with astropy v 4.1 in the past, maybe it's related to that. This was fixed with 4.2, try to force astropy to this version, or, as in shapepipe now, 5.0.

@andrevitorelli
Copy link
Author

When trying to install with pip install mccd==1.2.3 I get a pysap installation error. Still looking into it...

@andrevitorelli
Copy link
Author

Pointing out to the root cause of the install fail here: CEA-COSMIOC/pysap/#178

@andrevitorelli
Copy link
Author

Issue above solves this.

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