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

Installing spyder with conda results in the conda-activate.sh file having incorrect permissions and line-endings. #14494

Closed
6 of 10 tasks
b-a0 opened this issue Dec 23, 2020 · 3 comments

Comments

@b-a0
Copy link

b-a0 commented Dec 23, 2020

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

When installing spyder with conda the permissions of the conda-activate.sh script are incorrect, they're missing execute permissions.

Additionally, the line endings are Windows style line endings. This being an .sh script this results in an error when Spyder is started with a non-default interpreter (as it then tries to use this script I assume).

What steps reproduce the problem?

Not sure how to force that conda re-downloads a package, hence the first two steps.

  1. Remove all conda environment with spyder 4.2.1 installed in them.
  2. Clean all cached conda packages: conda clean --all
  3. Create a new conda environment with spyder in it: conda create --name spyder python=3.8; conda activate spyder; conda install -c conda-forge spyder
  4. Create a separate conda environment: conda create --name some_project python=3.8 spyder-kernels
  5. Start spyder: conda activate spyder; spyder
  6. In the spyder preference set the non-default python interpreter (some_project from step 4).
  7. Restart spyder

What is the expected output? What do you see instead?

Expected: spyder starts with a console from some_project.

Actual: an error is shown:

An error ocurred while starting the kernel
The error is:

Traceback (most recent call last):
File "/Users/ba/opt/anaconda3/envs/spyder/lib/python3.8/site‑packages/spyder/plugins/ipythonconsole/plugin.py", line 1427, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle,
File "/Users/ba/opt/anaconda3/envs/spyder/lib/python3.8/site‑packages/jupyter_client/manager.py", line 313, in start_kernel
self.kernel = self._launch_kernel(kernel_cmd, **kw)
File "/Users/ba/opt/anaconda3/envs/spyder/lib/python3.8/site‑packages/jupyter_client/manager.py", line 220, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "/Users/ba/opt/anaconda3/envs/spyder/lib/python3.8/site‑packages/jupyter_client/launcher.py", line 131, in launch_kernel
proc = Popen(cmd, **kwargs)
File "/Users/ba/opt/anaconda3/envs/spyder/lib/python3.8/subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Users/ba/opt/anaconda3/envs/spyder/lib/python3.8/subprocess.py", line 1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/Users/ba/opt/anaconda3/envs/spyder/lib/python3.8/site‑packages/spyder/plugins/ipythonconsole/scripts/conda‑activate.sh'

When checking the permissions of the script file they seem to be missing the x permission:

➜ ls -lah /Users/ba/opt/anaconda3/pkgs/spyder-4.2.1-py38h50d1736_0/lib/python3.8/site-packages/spyder/plugins/ipythonconsole/scripts/conda-activate.sh 
-rw-rw-r--  2 ba  staff   393B Dec 20 02:50 /Users/ba/opt/anaconda3/pkgs/spyder-4.2.1-py38h50d1736_0/lib/python3.8/site-packages/spyder/plugins/ipythonconsole/scripts/conda-activate.sh

After fixing that with chmod a+x conda-activate.sh spyder starts with a non-default interpeter some_project, but shows a different error:

An error ocurred while starting the kernel
env: bash\r: No such file or directory
env: bash\r: No such file or directory

Checking the line endings of conda-activate.sh I see that these are Windows style, not unix style:

➜ file conda-activate.sh 
conda-activate.sh: Bourne-Again shell script text executable, ASCII text, with CRLF line terminators

Once that is fixed (i.e. line endings are converted to unix style) I end up with issue #14480.

Versions

  • Spyder version: 4.2.1 None
  • Python version: 3.8.6 64-bit
  • Qt version: 5.12.9
  • PyQt5 version: 5.12.3
  • Operating System: Darwin 20.2.0

Dependencies


# Mandatory:
applaunchservices >=0.1.7       :  0.2.1 (OK)
atomicwrites >=1.2.0            :  1.4.0 (OK)
chardet >=2.0.0                 :  4.0.0 (OK)
cloudpickle >=0.5.0             :  1.6.0 (OK)
diff_match_patch >=20181111     :  20200713 (OK)
intervaltree >=3.0.2            :  3.0.2 (OK)
IPython >=7.6.0                 :  7.19.0 (OK)
jedi =0.17.2                    :  0.17.2 (OK)
jsonschema >=3.2.0              :  3.2.0 (OK)
keyring >=17.0.0                :  21.7.0 (OK)
nbconvert >=4.0                 :  6.0.7 (OK)
numpydoc >=0.6.0                :  1.1.0 (OK)
parso =0.7.0                    :  0.7.0 (OK)
pexpect >=4.4.0                 :  4.8.0 (OK)
pickleshare >=0.4               :  0.7.5 (OK)
psutil >=5.3                    :  5.8.0 (OK)
pygments >=2.0                  :  2.7.3 (OK)
pylint >=1.0                    :  2.6.0 (OK)
pyls >=0.36.2;<1.0.0            :  0.36.2 (OK)
pyls_black >=0.4.6              :  0.4.6 (OK)
pyls_spyder >=0.3.0             :  0.3.0 (OK)
qdarkstyle >=2.8                :  2.8.1 (OK)
qtawesome >=0.5.7               :  1.0.2 (OK)
qtconsole >=5.0.1               :  5.0.1 (OK)
qtpy >=1.5.0                    :  1.9.0 (OK)
rtree >=0.8.3                   :  0.9.5 (OK)
setuptools >=39.0.0             :  49.6.0.post20201009 (OK)
sphinx >=0.6.6                  :  3.4.0 (OK)
spyder_kernels >=1.10.1;<1.11.0 :  1.10.1 (OK)
textdistance >=4.2.0            :  4.2.0 (OK)
three_merge >=0.1.1             :  0.1.1 (OK)
watchdog >=0.10.3               :  1.0.2 (OK)
zmq >=17                        :  20.0.0 (OK)

# Optional:
cython >=0.21                   :  None (NOK)
matplotlib >=2.0.0              :  None (NOK)
numpy >=1.7                     :  None (NOK)
pandas >=1.1.1                  :  None (NOK)
scipy >=0.17.0                  :  None (NOK)
sympy >=0.7.3                   :  None (NOK)
@spyder-bot
Copy link
Collaborator

Thanks for reporting. To fix this, please open the Anaconda Prompt and run there the following commands:

conda update anaconda
conda install jupyter_client=5.3.4

@ccordoba12
Copy link
Member

Hey @b-a0, could you reopen this issue here?

https://github.com/conda-forge/spyder-feedstock

That's where it needs to be fixed, not here.

@b-a0
Copy link
Author

b-a0 commented Dec 23, 2020

Thanks for pointing me to the correct repository, I've opened an issue there: #90

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

No branches or pull requests

3 participants