env:
I try the config:
ipython -i -c "import sys; sys.path.append('path_name')"
But it does not seem to work.
So what's the proper solution?
Or how to add current directory to sys.path on ipython startup?
Thanks.
just a little follow up to Honghe.Wu's answer.
One might want to add:
c.InteractiveShellApp.exec_lines = [
'import sys; sys.path.append("/absolute/path/")']
to the ipython_config.py to add an arbitrary directory.
Also, if you are new to ipython (as I am) you need to create the standard profile first, so the ipython_config.py actually exists. So you need:
ipython profile create
and you can locate the configuration directory by
ipython locate
Best S
With the help of @cartman, I currently use the flowing config in the file ipython_config.py
to add current directory to sys.path:
c.InteractiveShellApp.exec_lines = [
'import sys,os; sys.path.append(os.getcwd())'
]
Until there is a better solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With