0

I'm Getting the following errors while using python3 from a fixed location, here it is 'python' Directory (/home/pi/python)

pi@rituraj:~/python $ python3
Python 3.4.2 (default, Feb 10 2019, 17:23:02)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
Failed calling sys.__interactivehook__
Traceback (most recent call last):
File "/usr/lib/python3.4/site.py", line 420, in register_readline
import rlcompleter
File "/usr/lib/python3.4/rlcompleter.py", line 161, in <module>
readline.set_completer(Completer().complete)
AttributeError: 'module' object has no attribute 'set_completer'

And this is causing problem in python module import. Like I cannot import pycrypto.

But While Accessing python3 from a different directory location, it is working fine

pi@rituraj:~/vivek $ python3
Python 3.4.2 (default, Feb 10 2019, 17:23:02)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.

And from this directory there is no error and I can import any python module.

Note: I have tried to Change the permissions of the directory, but it didn't worked.

Thanks in Advance!

  • 'python' Directory in my home folder What is in that directory? Seems like something in there is confusing python. Please add relevant info to your question. – Dirk Feb 20 at 15:23
  • What does env | grep PYTHON show? – glenn jackman Feb 20 at 15:49
  • It doesn't shows anything, but 'env' does show info about ssh connection current directory and some other info. @glennjackman – Rituraj Rautela Feb 20 at 16:30
  • it is /home/pi/python directory, it seems like there is something wrong with the files inside the directory. when I copy file to another directory same problems occur. @Dirk – Rituraj Rautela Feb 20 at 16:32
  • Is the directory a real directory or a maybe a symlink to somewhere else? Can you add the details of that directory to your question (use e.g. ls -lsa /home/pi/python) – Dirk Feb 20 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.