Startup run code of IPython is not working when using projects
See original GitHub issueDescription
What steps will reproduce the problem?
Hello.
This promblem is similar to #16748. This issue is also occurring in 5.x branch.
Thank you.
Versions
- Spyder version: 5.4.0.dev0 30e09f8ee
- Python version: 3.9.12
- Qt version: 5.12.9
- PyQt5 version: 5.12.3
- Operating System: Linux 5.4.0-110-generic
Dependencies
# Mandatory:
atomicwrites >=1.2.0 : 1.4.0 (OK)
chardet >=2.0.0 : 4.0.0 (OK)
cloudpickle >=0.5.0 : 2.0.0 (OK)
cookiecutter >=1.6.0 : 1.7.3 (OK)
diff_match_patch >=20181111 : 20200713 (OK)
intervaltree >=3.0.2 : 3.1.0 (OK)
IPython >=7.31.1;<8.0.0 : 7.33.0 (OK)
jedi >=0.17.2;<0.19.0 : 0.18.1 (OK)
jellyfish >=0.7 : 0.8.2 (OK)
jsonschema >=3.2.0 : 4.4.0 (OK)
keyring >=17.0.0 : 23.4.0 (OK)
nbconvert >=4.0 : 6.4.4 (OK)
numpydoc >=0.6.0 : 1.2 (OK)
parso >=0.7.0;<0.9.0 : 0.8.3 (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.11.2 (OK)
pylint >=2.5.0 : 2.9.6 (OK)
pyls_spyder >=0.4.0 : 0.4.0 (OK)
pylsp >=1.4.1;<1.5.0 : 1.4.1 (OK)
pylsp_black >=1.2.0 : 1.2.1 (OK)
qdarkstyle >=3.0.2;<3.1.0 : 3.0.3 (OK)
qstylizer >=0.1.10 : 0.1.10 (OK)
qtawesome >=1.0.2 : 1.0.3 (OK)
qtconsole >=5.3.0;<5.4.0 : 5.4.0.dev0 (OK)
qtpy >=2.1.0 : 2.1.0 (OK)
rtree >=0.9.7 : 0.9.7 (OK)
setuptools >=49.6.0 : 59.5.0 (OK)
sphinx >=0.6.6 : 4.4.0 (OK)
spyder_kernels >=2.3.0;<2.4.0 : 2.4.0.dev0 (OK)
textdistance >=4.2.0 : 4.2.1 (OK)
three_merge >=0.1.1 : 0.1.1 (OK)
watchdog >=0.10.3 : 2.1.6 (OK)
xdg >=0.26 : 0.27 (OK)
zmq >=17 : 22.3.0 (OK)
# Optional:
cython >=0.21 : 0.29.28 (OK)
matplotlib >=3.0.0 : 3.5.1 (OK)
numpy >=1.7 : 1.21.5 (OK)
pandas >=1.1.1 : 1.4.2 (OK)
scipy >=0.17.0 : 1.7.3 (OK)
sympy >=0.7.3 : 1.10.1 (OK)
# Spyder plugins:
spyder_okvim.spyder.plugin 0.0.1.dev0 : 0.0.1-dev0 (OK)
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
How to create a project specific startup script for ipython
The best way to do this would be to create a .ipython directory in your project directory. You can do this as: $...
Read more >What to do when things go wrong - The Jupyter Notebook
If you're using a menu shortcut or Anaconda launcher to start it, try opening a terminal or command prompt and running the command...
Read more >Is iPython still virtualenv unaware? - Google Groups
Searching the web for the issue, I found a few posts suggesting that iPython was "unaware" of virtual environments, Calling IPython from a...
Read more >IntelliJ IDEA - Jupyter notebook support - JetBrains
To start working with Jupyter notebooks in IntelliJ IDEA: Create a new project, ... Execute any of the code cells to launch the...
Read more >Introducing IPython — IPython 3.2.1 documentation
Startup Files¶ ... If you want some code to be run at the beginning of every IPython session, the easiest way is to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the step by step description @ok97465 ! I was able to reproduce this 👍 Seems like the console when opening a project is not getting the correct working directory set (I’m getting for the first console open with the project my home directory instead):
Checking the working directory options I’m seeing this:
My vim has a completely different structure from the spyder vim, so I have to create and upload all the new files. If I do that, my vim has an intermittent error and the bug is often reported on Spyder-ide, which will annoy you. I think it would be better to make the spyder-vim compatible with the spyder 5, and I will try it within next month.
The initial files(import_in_console.py) within the project are as follows:
Preference > IPython Console > Startup > Run code is below: