Where to get sphinxcontrib.autohttp.flask? - python

I am looking to generate automatic documentation for the REST API of a Flask project. I can't locate the sphinx extension sphinxcontrib.autohttp.flask anywhere and it does not seem to come bundled with sphinx. When I run sphinx I get :
Extension error:
Could not import extension sphinxcontrib.autohttp.flask (exception: No module named sphinxcontrib.autohttp.flask)
Can somebody give me a pointer to where to find it?

The sphinxcontrib.autohttp.flask module lives in the sphinxcontrib.httpdomain contrib extension which you can find here https://bitbucket.org/birkenfeld/sphinx-contrib or you can install it directly using pip like this:
pip install sphinxcontrib-httpdomain

Related

Module Not Found Error For Custom Pypi Package

I am trying to upload my package to pypi and use it. Using Twine i upload it to pypi but when i try to use this package I get Module not found error.
My Error :
My Folder structure for the package is :
The error points to the modelpg/__init__.py , here's my modelpg/__init__.py file.
Is it due to my package name is same as .py file.
EDIT 1 :
My Transformer/__init__.py file
All of the imports in modelpg/__init__.py would need to either be relative:
from .Transformer.transformer import Transformer
or absolute, with the modelpg package name:
from modelpg.Transformer.transformer import Transformer
This has nothing to do with PyPI, by the way – the same applies even if the package wasn't installed from there.

"sharepoint" and "sharepy" packages unable to import

I'm trying to write a script in python that will modify files and folders in a sharepoint site. Based off what I've read online about working with sharepoint using python, I tried to install and import the "sharepoint" and "sharepy" modules.
I used "pip install sharepoint" and "pip install sharepy" in the command prompt to install the packages, and then in my script used these lines to import the packages:
import sharepoint
import sharepy
Multiple IDE's don't recognize the packages (in Visual Studio, the error says "No module named 'sharepoint'") and I can't use their libraries to complete my code. The modules in question are present in the same subfolder as other modules that do successfully import, so I'm not really understanding the problem here. What could be causing these libraries to not import?
in visual studio code change python path to where you installed python
You don't need a module named "sharepoint"
Instead of that, you have to install : office365-rest-python-client
(with pip)

AWS Lambda -- Unable to import srsly.ujson.ujson for SpaCy

I am trying to add SpaCy as a dependency to my Python Lambda. I am doing this by installing SpaCy as a standalone dependency inside a directory named dependencies using pip3 install spacy --no-deps -t . This is because I can't load the entire Spacy dependency inside the \tmp directory of my Lambda.
I am able to successfully upload the folder to s3 and download it during the Lambda invocation. When I try to import spacy, I get this error: [ERROR] Runtime.ImportModuleError: Unable to import module : No module named 'srsly.ujson.ujson'.
I manually installed srsly inside dependencies\ and I have all the files that are listed as per this link. This was referenced by this link. One of the responses says, "it seems like Python can't load it, because it's not compiled?". How would I compile a dependency which has a .c file in it?
One other question which I found on SO is this question, but I have already manually installed srsly. How to I import the module? Thanks.
I manually check in my code for the presence of ujson before importing spacy like this:
if os.path.exists('/tmp/dependencies/srsly/ujson/ujson.c'):
print('ujson exists')
and the print statement gets printed.
For me pip uninstalling and installing srsly again worked fine.. sometimes its just the compatibility issue with your python version so make sure correct python/srsly versions are present
Well it is a bit strange, but my solution for this problem was to create an aditional "ujson" folder in the srsly folder and then move all the ujson generated code to the folder "ujson" previously created

Pip - No module named vimpdb

I'm trying to install the vimpdb lib but it's working, even though I successfully installed vimpdb using pip install I always get this error:
import vimpdb; vimpdb.set_trace();
ImportError: No module named vimpdb
I'm running the code locally but when I run the same code as a simple script (without using localhost) it imports correctly, it only throws an error when I start a server and begin to try using this plugin.
Any ideas?
Thansk!
App Engine won't import Python modules on your Python path. You need to actually include the module within the App Engine project.
For example, in the same directory as app.yaml, you could add a symbolic link similar to this:
vimpdb -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vimpdb
Or you could copy the vimpdb directory to that location.

Error while installing wxPython package in a non-standard path

I am a relative newbie with Python and was trying to install wxPython 2.9 using Python 2.6. I did a build from source and then installed the package both being done in a non-standard (local) path. When I try and import wx (having provided the path to the installation folder in my environment variable), I get the following error message:
"ImportError:
libwx_gtk2u_xrc-2.9.so.1: cannot open
shared object file: No such file or
directory".
Can someone please tell me if I need to build gtk separately? And if yes, how do I go about doing it?
Add the directory containing the library given in the error to your ld search paths. See the ldconfig(8) man page for details.

Categories