简体   繁体   中英

Why doesn't python 2.7.10 recognize my .pystartup and .inputrc?

Following this for my ~/.pystartup and adding export PYTHONSTARTUP="~/.pystartup" to my .bash_profile. After I open a new terminal, and fire up python I get

Python 2.7.10 (default, Jul 14 2015, 19:46:27) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Could not open PYTHONSTARTUP
IOError: [Errno 2] No such file or directory: '~/.pystartup'

~/pystarup definitely exists. I also would like vi key bindings and when I put set editing-mode vi in my ~/.inputrc, I still do NOT get the appropriate bindings.

I am working on OSX 10.10.5. How do I fix these issues?

Since my comment helped the OP, I'm gonna copy it here: Python doesn't seem to recognize shell-specific features like ~ replaced with the Home directory, so it's better to manually replace ~ with the full path to the home directory in this case.

Speaking about .inputrc problems: Mac OS doesn't even use it. Instead, you should use your ~/.editrc . So, you can run man editor to get more information. See this SO answer for more information on this topic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM