Emacs deferred errors - python

I have installed the Emacs package jedi-emacs using M-x package install
and the following Python packages:
Jedi
EPC
argparse
using:
pip install --install-option="--prefix=~/.my_python_packages/" jedi
pip install --install-option="--prefix=/.my_python_packages/" epc
pip install --install-option="--prefix=/.my_python_packages/" argparse
since I do not have root priviledges.
When I open a Python file, I get the following error in the minibuffer, no matter where I place the cursor:
deferred error : (error Server may raise an error : Traceback (most recent call last):
File "/home/avazquez/.emacs.d/elpa/jedi-20130119.830/jediepcserver.py", line 261, in <module>
)
What could be causing it?
This is with Emacs 24.2.1

I found the solution to my problem. I did not have PYTHONPATH set up correctly (it should include the corresponding paths for /path/to/custom-packages).
For more info on this issue see the corresponding ticket in the package repository for emacs-jedi.

Related

AttributeError: Module 'pip' has no attribute 'logging' [duplicate]

I am writing because I am having trouble installing Pyomo using pip on Python 3.6 on Mac OSX 10.14
I'm following the installation instructions here.
I can successfully execute the first command:
pip install pyomo
But when I run into trouble when I'm supposed to run the following command to install additional dependencies:
pyomo install-extras
Running this command produces the following error:
Traceback (most recent call last):
File "/usr/local/bin/pyomo", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/pyomo/scripting/pyomo_main.py", line 82, in main
retval = _options.func(_options)
File "/usr/local/lib/python3.6/site-packages/pyomo/scripting/driver_help.py", line 46, in install_extras_exec
pyutilib.subprocess.run(command, tee=True)
File "/usr/local/lib/python3.6/site-packages/pyutilib/subprocess/processmngr.py", line 690, in run_command
th.join()
UnboundLocalError: local variable 'th' referenced before assignment
There is a post about this here on Google Groups but no solution yet.
This is a documented issue on the github for Pyomo: https://github.com/Pyomo/pyomo/issues/243
They don't appear to have solved the pip installation of pyomo extras.
However, if you have conda installed - https://docs.conda.io/en/latest/
You should be able to use the terminal commands from:
https://pyomo.readthedocs.io/en/latest/installation.html
run this in terminal after conda has been successfully installed:
conda install -c conda-forge pyomo.extras
I know this isn't pip, but it's at least a workaround until pyomo fixes their documentation.
confirmed working on python 3.x and ubuntu 18.04
I got the problem too (in Ubuntu 18.04).
Try installing it from the git project (https://github.com/Pyomo/pyomo):
In Ubuntu 18.04:
git clone https://github.com/Pyomo/pyomo.git
python3 pyomo/scripts/get_pyomo_extras.py
Use the corresponding commands for Mac OSX (I had never used it).
I hope that it works for you.

ImportError: No module named 'gdbm' occuring while using source ~/.bashrc

Hey after making some changes in the bashrc I tried to use
source ~/.bashrc
but got the following error
baaz#FireStorm:~$ source ~/.bashrc
Traceback (most recent call last):
File "/usr/lib/python3.5/dbm/gnu.py", line 4, in <module>
from _gdbm import *
ImportError: No module named '_gdbm'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module>
import dbm.gnu as gdbm
File "/usr/lib/python3.5/dbm/gnu.py", line 6, in <module>
raise ImportError(str(msg) + ', please install the python3-gdbm package')
ImportError: No module named '_gdbm', please install the python3-gdbm package
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 27, in <module>
from CommandNotFound.util import crash_guard
File "/usr/lib/python3/dist-packages/CommandNotFound/__init__.py", line 3, in <module>
from CommandNotFound.CommandNotFound import CommandNotFound
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in <module>
import gdbm
ImportError: No module named 'gdbm'
I tried using the install commands as mentioned in the error
baaz#FireStorm:~$ sudo apt-get install python3-gdbm
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-gdbm is already the newest version (3.6.5-3~16.04.york0.2).
python3-gdbm set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Also some solutions mentioned to use version specific commands, but still got no solution
baaz#FireStorm:~$ sudo apt-get install python3.5-gdbm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python3.5-gdbm is a virtual package provided by:
python3-gdbm 3.5.1-1 [Not candidate version]
E: Package 'python3.5-gdbm' has no installation candidate
The pip install command gave the following error
baaz#FireStorm:~$ sudo pip3 install gdbm --upgrade
The directory '/home/baaz/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/baaz/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting gdbm
Could not find a version that satisfies the requirement gdbm (from versions: )
No matching distribution found for gdbm
Please suggest a way to sort out these error.
Your error is occurring most likely because your .bashrc contains a typo somewhere, therefore command-not-found is being called, but command-not-found appears to have been recently broken. (You should get the same error if you type some nonsense into your terminal directly.)
sudo apt install python3-gdbm=3.5.1-1
worked for me.
From running
dpkg -L python3-gdbm
it looked like gdbm on my computer is being installed to python3.6 for some reason, not python3.5, but my python3 version is python3.5 (and last I checked python3.6 breaks something on ubuntu 16.04).
The error you got when you ran
sudo apt-get install python3.5-gdbm
complained about a version issue, hence manually installing the version they noted worked.
This worked for me:
sudo ln -s /usr/lib/python3.6/lib-dynload/_gdbm.cpython-36m-x86_64-linux-gnu.so /usr/lib/python3.5/lib-dynload/_gdbm.cpython-35m-x86_64-linux-gnu.so
Note the 35m in the the link's name.

Syntax error when installing csc-pysparse

I am new to Python and I am trying to install recsys package.
http://ocelma.net/software/python-recsys/build/html/installation.html
For this i need to install some pre-requiste packages, so i have to run this using pip
pip install csc-pysparse networkx divisi2
But whenever i run this i get the following in logs
Collecting csc-pysparse
Using cached csc-pysparse-1.1.1.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\64\AppData\Local\Temp\pip-build-wn7_65_9\csc-pysparse\
setup.py", line 33
print 'setuptools module not found.'
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\i054564\
AppData\Local\Temp\pip-build-wn7_65_9\csc-pysparse\
I checked that setuptools exist in my python installation here
C:\Python34\lib\site-packages
I have ran everything from unstinalling setuptools to install it again, upgrade command, but it does not work.
Not able to figure out why setuptools is not found. Is it not found in the path of where pip resolves it from ?
cheers,
Saurav
The code triggering the error is Python 2-specific and is illegal in Python 3.
Apparently, csc-pysparse doesn't support Python 3 (its README only mentions 2.6) and looks abandoned (6 years since last commit).
Some guys out there suggest replacing it with SciPy.
The error is coming from the installation code of recsys package. In order to avoid this error, you need to install setuptools separately.
For debian machines, the below command will work.
sudo apt-get install python3-setuptools
For other machines, please checkout installation instructions at the link
Once setuptools package is installed, you can proceed with csc-pysparse installation.

Failure: Centos 6.4 python easy_install is broken

I've looked at quite a lot of related questions here - no help for me. I need to repair easy_install, so that I can update distribute to a version >=0.6.28, so that I can update python matplotlib using pip and not yum.
In the process of trying to update python matplotlib from 0.99 (the default with Centos64) to 1.4.x, I got into this trouble:
pip install --upgrade matplotlib tells me this:
Complete output from command python setup.py egg_info:
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.10 (/usr/lib/python2.6/site-packages))
So I followed the suggestion and saw that some 0.7.x version of distribute was installed (so it seemed). Re-ran the pip command and got the exact same complaint.
Trouble with easy_install?
It was either now, or maybe after performing yum remove, then install python-setuptools that I discovered easy_install is thoroughly broken. Now when I try to run easy_install, I get this stacktrace:
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 9, in <module>
load_entry_point('distribute', 'console_scripts', 'easy_install')()
File "/usr/local/lib/python3.3/site-packages/setuptools-18.2-py3.3.egg/pkg_resources/__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.3/site-packages/setuptools-18.2-py3.3.egg/pkg_resources/__init__.py", line 2681, in load_entry_point
raise ImportError("Entry point %r not found" % ((group, name),))
ImportError: Entry point ('console_scripts', 'easy_install') not found
Look at that - why is it referring to python3.3? I don't think I've got that installed. My default python is 2.6.6.
Any ideas? TIA.
Fixed it. The python3.3 bit was my clue. I found the python script for easy_install, in /usr/local/bin. The very first line designated /usr/bin/python3.3 to execute the script. Changed to 2.6 and then was good to go.
In the end I was not able to upgrade matplotlib from 0.99 to 1.4.3, because I could not upgrade basemap from 0.99 and some conflicts arose. Rather than punish myself with trying to build from source, I think I should simply upgrade my entire VM to Centos7 and I will then have much newer matplotlib.

Installing SSL Module for Python (2.5.4) on Windows

since AppEngine requires to upload your apps via SSL I tried to install the module on my working laptop.
It is a x64 Win 7 System with Python 2.5.4 x86 installed.
I followed guides such as this one: How to install Python ssl module on Windows?
and also all related links.
But the major problem is, that neither MinGw nor GnuWin seems to really work.
GnuWin is perfectly installed, up to date and has all dependencies it needs to build the SSL module.
But typing in
> "C:\Python25\python.py" setup.py install -c mingw32
just badly fails.
So does "-cmingw32" and "-gnuwin32".
(-cmingw32 obviously fails, because even though MinGW is fully installed MinGw is not regcognized)
"build" instead of install seems to "output" something:
MinGw complains about "ggc no such file or directory", and with GnuWin "it doesn't know how to compile C/C++ on a nt with gnuwin"
This sounds like total garbage to me, because I did everything as described in the tutorials.
I fixed one part of my problem: gcc is now getting recognized by easy_install but AE still complains about the missing SSL module though both, easy_install and python say Pycrypto incl. SSL is successfully installed
easy_install ssl
C:\Users\faits>easy_install ssl
Searching for ssl
Best match: ssl 1.15
Adding ssl 1.15 to easy-install.pth file
Using c:\python25\lib\site-packages
Processing dependencies for ssl
Finished processing dependencies for ssl
easy_install pycrypto
C:\Users\faits>easy_install ssl
Searching for ssl
Best match: ssl 1.15
Adding ssl 1.15 to easy-install.pth file
Using c:\python25\lib\site-packages
Processing dependencies for ssl
Finished processing dependencies for ssl
python
IDLE 1.2.4
>>> import ssl
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import ssl
File "C:\Python25\lib\site-packages\ssl\__init__.py", line 61, in <module>
import _ssl2 # if we can't import it, let the error propagate
ImportError: No module named _ssl2
python
>>> import pycrypto
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import pycrypto
ImportError: No module named pycrypto
I've summed up all the instructions nicely on the following link. Do check it out.
http://waqasshabbir.tumblr.com/post/18010535789/ssl-module-for-python-2-5-installation-windows-only
Use -c with the build command.
Compare:
$ python setup.py install -c
--compile (-c) compile .py to .pyc [default]
with:
$ python setup.py build -c
--compiler (-c) specify the compiler type
To find out other options , run:
$ python setup.py build --help

Categories