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. #90

Closed
1 task done
b-a0 opened this issue Dec 23, 2020 · 0 comments · Fixed by #92
Closed
1 task done
Assignees

Comments

@b-a0
Copy link

b-a0 commented Dec 23, 2020

Issue:

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 a different issue which is out of scope of the current repository.


Environment (conda list):
➜ conda activate spyder
➜ conda list
# packages in environment at /Users/ba/opt/anaconda3/envs/spyder:
#
# Name                    Version                   Build  Channel
alabaster                 0.7.12                     py_0    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
applaunchservices         0.2.1                      py_0    conda-forge
appnope                   0.1.2            py38h50d1736_0    conda-forge
argh                      0.26.2          pyh9f0ad1d_1002    conda-forge
astroid                   2.4.2            py38h32f6830_1    conda-forge
async_generator           1.10                       py_0    conda-forge
atomicwrites              1.4.0              pyh9f0ad1d_0    conda-forge
attrs                     20.3.0             pyhd3deb0d_0    conda-forge
autopep8                  1.5.4              pyh9f0ad1d_0    conda-forge
babel                     2.9.0              pyhd3deb0d_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.1                      py_0    conda-forge
black                     20.8b1                     py_1    conda-forge
bleach                    3.2.1              pyh9f0ad1d_0    conda-forge
brotlipy                  0.7.0           py38h94c058a_1001    conda-forge
ca-certificates           2020.12.5            h033912b_0    conda-forge
certifi                   2020.12.5        py38h50d1736_0    conda-forge
cffi                      1.14.4           py38h979bc6b_1    conda-forge
chardet                   4.0.0            py38h50d1736_0    conda-forge
click                     7.1.2              pyh9f0ad1d_0    conda-forge
cloudpickle               1.6.0                      py_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
cryptography              3.3.1            py38h6b4ec92_0    conda-forge
dataclasses               0.7                pyhb2cacf7_7    conda-forge
dbus                      1.13.6               h0c50699_1    conda-forge
decorator                 4.4.2                      py_0    conda-forge
defusedxml                0.6.0                      py_0    conda-forge
diff-match-patch          20200713           pyh9f0ad1d_0    conda-forge
docutils                  0.16             py38h50d1736_2    conda-forge
entrypoints               0.3             pyhd8ed1ab_1003    conda-forge
expat                     2.2.9                hb1e8313_2    conda-forge
flake8                    3.8.4                      py_0    conda-forge
future                    0.18.2           py38h50d1736_2    conda-forge
gettext                   0.19.8.1          h7937167_1005    conda-forge
glib                      2.66.4               h22858aa_1    conda-forge
helpdev                   0.7.1              pyhd8ed1ab_0    conda-forge
icu                       68.1                 h74dc148_0    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
imagesize                 1.2.0                      py_0    conda-forge
importlib-metadata        3.3.0            py38h50d1736_2    conda-forge
importlib_metadata        3.3.0                hd8ed1ab_2    conda-forge
intervaltree              3.0.2                      py_0    conda-forge
ipykernel                 5.4.2            py38h9bb44b7_0    conda-forge
ipython                   7.19.0           py38h9bb44b7_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
isort                     5.6.4                      py_0    conda-forge
jedi                      0.17.2           py38h50d1736_1    conda-forge
jinja2                    2.11.2             pyh9f0ad1d_0    conda-forge
jpeg                      9d                   hbcb3906_0    conda-forge
jsonschema                3.2.0                      py_2    conda-forge
jupyter_client            6.1.7                      py_0    conda-forge
jupyter_core              4.7.0            py38h50d1736_0    conda-forge
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
keyring                   21.7.0           py38h50d1736_0    conda-forge
krb5                      1.17.2               h60d9502_0    conda-forge
lazy-object-proxy         1.4.3            py38h4d0b108_2    conda-forge
libclang                  11.0.0          default_h9e6edd0_2    conda-forge
libcxx                    11.0.0               h4c3b8ed_1    conda-forge
libedit                   3.1.20191231         h0678c8f_2    conda-forge
libffi                    3.3                  h046ec9c_2    conda-forge
libglib                   2.66.4               h7424822_1    conda-forge
libiconv                  1.16                 haf1e3a3_0    conda-forge
libllvm11                 11.0.0               hf85e3d2_0    conda-forge
libpng                    1.6.37               h7cec526_2    conda-forge
libpq                     12.3                 h7049927_3    conda-forge
libsodium                 1.0.18               hbcb3906_1    conda-forge
libspatialindex           1.9.3                h4a8c4bd_3    conda-forge
lz4-c                     1.9.2                hb1e8313_3    conda-forge
markupsafe                1.1.1            py38h94c058a_2    conda-forge
mccabe                    0.6.1                      py_1    conda-forge
mistune                   0.8.4           py38h7e3306e_1002    conda-forge
mypy_extensions           0.4.3            py38h50d1736_2    conda-forge
mysql-common              8.0.22               h694c41f_1    conda-forge
mysql-libs                8.0.22               hcb0700d_1    conda-forge
nbclient                  0.5.1                      py_0    conda-forge
nbconvert                 6.0.7            py38h50d1736_3    conda-forge
nbformat                  5.0.8                      py_0    conda-forge
ncurses                   6.2                  h2e338ed_4    conda-forge
nest-asyncio              1.4.3              pyhd8ed1ab_0    conda-forge
nspr                      4.29                 hb1e8313_1    conda-forge
nss                       3.47                 hc0980d9_0    conda-forge
numpydoc                  1.1.0                      py_1    conda-forge
openssl                   1.1.1i               h35c211d_0    conda-forge
packaging                 20.8               pyhd3deb0d_0    conda-forge
pandoc                    2.11.3.1             h35c211d_0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parso                     0.7.0              pyh9f0ad1d_0    conda-forge
pathspec                  0.8.1              pyhd3deb0d_0    conda-forge
pcre                      8.44                 hb1e8313_0    conda-forge
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pip                       20.3.3             pyhd8ed1ab_0    conda-forge
pluggy                    0.13.1           py38h5347e94_3    conda-forge
prompt-toolkit            3.0.8              pyha770c72_0    conda-forge
psutil                    5.8.0            py38h5406a74_0    conda-forge
ptyprocess                0.6.0                   py_1001    conda-forge
pycodestyle               2.6.0              pyh9f0ad1d_0    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pydocstyle                5.1.1                      py_0    conda-forge
pyflakes                  2.2.0              pyh9f0ad1d_0    conda-forge
pygments                  2.7.3              pyhd8ed1ab_0    conda-forge
pylint                    2.6.0            py38h32f6830_1    conda-forge
pyls-black                0.4.6              pyh9f0ad1d_0    conda-forge
pyls-spyder               0.3.0              pyhd8ed1ab_0    conda-forge
pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyqt                      5.12.3           py38h50d1736_6    conda-forge
pyqt-impl                 5.12.3           py38h721a93c_6    conda-forge
pyqt5-sip                 4.19.18          py38h5745d40_6    conda-forge
pyqtchart                 5.12             py38h721a93c_6    conda-forge
pyqtwebengine             5.12.1           py38h721a93c_6    conda-forge
pyrsistent                0.17.3           py38h7e3306e_1    conda-forge
pysocks                   1.7.1            py38h5347e94_2    conda-forge
python                    3.8.6           h624753d_2_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python-jsonrpc-server     0.4.0              pyh9f0ad1d_0    conda-forge
python-language-server    0.36.2             pyhd8ed1ab_0    conda-forge
python.app                1.3              py38h5406a74_3    conda-forge
python_abi                3.8                      1_cp38    conda-forge
pytz                      2020.4             pyhd8ed1ab_0    conda-forge
pyyaml                    5.3.1            py38h94c058a_1    conda-forge
pyzmq                     20.0.0           py38h9b3f83f_1    conda-forge
qdarkstyle                2.8.1              pyhd8ed1ab_2    conda-forge
qt                        5.12.9               h126340a_2    conda-forge
qtawesome                 1.0.2              pyhd8ed1ab_0    conda-forge
qtconsole                 5.0.1              pyhd8ed1ab_0    conda-forge
qtpy                      1.9.0                      py_0    conda-forge
readline                  8.0                  h0678c8f_2    conda-forge
regex                     2020.11.13       py38h5406a74_0    conda-forge
requests                  2.25.1             pyhd3deb0d_0    conda-forge
rope                      0.18.0             pyh9f0ad1d_0    conda-forge
rtree                     0.9.5            py38hc59ffc2_0    conda-forge
setuptools                49.6.0           py38h5347e94_2    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
snowballstemmer           2.0.0                      py_0    conda-forge
sortedcontainers          2.3.0              pyhd8ed1ab_0    conda-forge
sphinx                    3.4.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    1.0.3                      py_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.4                      py_0    conda-forge
spyder                    4.2.1            py38h50d1736_0    conda-forge
spyder-kernels            1.10.1           py38h50d1736_0    conda-forge
sqlite                    3.34.0               h17101e1_0    conda-forge
testpath                  0.4.4                      py_0    conda-forge
textdistance              4.2.0              pyhd8ed1ab_0    conda-forge
three-merge               0.1.1              pyh9f0ad1d_0    conda-forge
tk                        8.6.10               h0419947_1    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tornado                   6.1              py38h7e3306e_0    conda-forge
traitlets                 5.0.5                      py_0    conda-forge
typed-ast                 1.4.1            py38h5406a74_1    conda-forge
typing_extensions         3.7.4.3                    py_0    conda-forge
ujson                     4.0.1            py38h11c0d25_1    conda-forge
urllib3                   1.26.2             pyhd8ed1ab_0    conda-forge
watchdog                  1.0.2            py38h5406a74_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.36.2             pyhd3deb0d_0    conda-forge
wrapt                     1.11.2           py38h4d0b108_1    conda-forge
wurlitzer                 2.0.0            py38h32f6830_2    conda-forge
xz                        5.2.5                haf1e3a3_1    conda-forge
yaml                      0.2.5                haf1e3a3_0    conda-forge
yapf                      0.30.0             pyh9f0ad1d_0    conda-forge
zeromq                    4.3.3                h74dc148_3    conda-forge
zipp                      3.4.0                      py_0    conda-forge
zlib                      1.2.11            h7795811_1010    conda-forge
zstd                      1.4.5                h289c70a_2    conda-forge


Details about conda and system ( conda info ):
➜ conda info

     active environment : None
            shell level : 0
       user config file : /Users/ba/.condarc
 populated config files : /Users/ba/.condarc
          conda version : 4.9.2
    conda-build version : 3.20.5
         python version : 3.7.8.final.0
       virtual packages : __osx=10.16=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /Users/ba/opt/anaconda3  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/ba/opt/anaconda3/pkgs
                          /Users/ba/.conda/pkgs
       envs directories : /Users/ba/opt/anaconda3/envs
                          /Users/ba/.conda/envs
               platform : osx-64
             user-agent : conda/4.9.2 requests/2.25.0 CPython/3.7.8 Darwin/20.2.0 OSX/10.16
                UID:GID : 502:20
             netrc file : /Users/ba/.netrc
           offline mode : False


@b-a0 b-a0 changed the title nstalling spyder with conda results in the conda-activate.sh file having incorrect permissions and line-endings. Installing spyder with conda results in the conda-activate.sh file having incorrect permissions and line-endings. Dec 23, 2020
@ccordoba12 ccordoba12 self-assigned this Jan 8, 2021
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

Successfully merging a pull request may close this issue.

2 participants