When developing query modules for Memgraph in Python how to get type completion? - memgraphdb

I'd like to have type completion when developing query modules for Memgraph in Python. Is it possible to add that?

You should install mgp. This is PyPi package used for type hinting when creating query modules. It can bee installed using pip install mgp. The package can also be found at https://pypi.org/project/mgp/.

Related

Trying to Avoid Using Two Package Managers (pip and Poetry) for the Same Project

After a fair bit of thrashing, I successfully installed the Python Camelot PDF table extraction tool (https://pypi.org/project/camelot-py/) and it works for the intended purpose. But in order to get it to work, aside from having to correct a deprecated dependency (by editing pyproject.toml and setting PyPDF2 =”2.12.1”) I used pip to install Camelot from within a Poetry (my preferred package manager) environment- because I haven’t yet figured out any other way.
Since I’m very new to Python and package management (but not to programming) I have some holes in my basic understanding that I need to patch up. I thought that using two package managers on the same project in principle defeats the purpose of using package managers, so I feel like I’m lucky that it works. Would love some input on what I’m missing.
The documentation for Camelot provides instructions for installing via pip and conda (https://camelot-py.readthedocs.io/en/master/user/install-deps.html), but not Poetry. As I understand (or misunderstand) it, packages are added to Poetry environments via the pyproject.toml file and then calling "poetry install."
I updated pyrpoject.toml as follows, having identified the current Camelot version as 0.10.1 (camelot --version):
[tool.poetry.dependencies]
python = "^3.8"
PyPDF2 = "2.12.1"
camelot = "^0.9.0"
This led to the error:
Because camelot3 depends on camelot (^0.9.0) which doesn't match any versions, version solving failed.
Same problem if I set (camelot = "0.10.1"). So I took the Camelot reference out of pyproject.toml, and ran the following command from within my Poetry virtual environment:
pip install “camelot-py[base]”
I was able to successfully proceed from here, but that doesn’t feel right. Is it wrong to try to force this project into Poetry, and should I instead consider using different package managers for different projects? Am I misunderstanding how Poetry works? What else am I missing here?
Whenever you see pip install 'Something[extra]' you can replace it with poetry add 'Something[extra]'.
Alternatively you can write it directly in the pyproject.toml and then run poetry install instead:
[tool.poetry.dependencies]
# ...
Something = { extras = ["extra"] }
Note that in your question you wrote camelot in the pyproject.toml but it is camelot-py that you should have written.

How to install multiple packages with winget?

How to install multiple packages with winget ?
Is this the only way ? https://github.com/microsoft/winget-cli/issues/219
I mean is there any ability out of the box ?
As of right now there is no way to install multiple packages with a single command - with the exception of winget import. If you know the Package Identifier and the source details, it is possible to create a JSON file that can be used to install a set of packages. However, this still involves the additional step of creating the JSON file

Fetch Google Places Data using Python

I'm trying to write a short python script which fetches data from Google Places API and exports it as a .csv file.
Unfortunately I'm stuck right at the beginning.
I want to use requests package but my machine cannot find it.
I've installed Python 3.5 on my Mac and when I use pip to install requests it says:
Requirement already satisfied: requests in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages
But when I run the program I get an import error which says:
ImportError: No module named requests
Do you have any ideas how i can fix this issue?
Thanks in advance.
Much love.
Use python -m pip install requests instead. Your pip installation was probably for a different version.

Overriding Conda Package Installation with Pip

I'm trying to build the necessary dependencies to run some deep learning code and am running into issues with the c foreign function interface (cffi) installation. I need conda's accelerate package, however the package is built on top of an old version of cffi (1.10). I need it to be built on top of cffi version 1.11.2 which I can obtain through pip. Is there some way to exclude certain sub-dependencies when installing through conda? I'd assume this would mess up my accelerate install even if I were able to somehow replace the cffi dependency, but figured I'd see what my options are regardless

whatprovides equivalent for pip or easy_install

In yum we can do a yum whatprovides *filename. Is there any such equivalent in pip or easy_install?
If I am getting an error in importing py module fooblabla, how can I find out which python egg/package provides that?
Did you try?
$ pip search <packagename>
This query searches the package metadata (including name, short description, keywords, among others).
It doesn't seem quite as deep a search as the whatprovides functionality, but unless you have the package installed already, it isn't clear how you would find the modules contained within that package (see answers here for that case).
However, I also don't see how you wouldn't know the package name if you were having problems importing a module from it.

Resources