I have created my own package for internal usage, that resides on GitLab, I have followed the doc and have successfully created the package. It has dist and whl folders/files as well. Still. it is throwing this error:
<gitlab link> does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.
However it has both the mentioned files in the error.
Related
I am pretty new with python and I have been running into an issue where I pip install a package, but then pycharm says that the package is not installed.
So far I have been able to get around this by just having pycharm install it for me. Now when I am trying to install requests-html, the install works fine, however, whenever I try to import requests_html, I get an error telling me that the package cannot be found. I did some digging through my files and found that it was installed under site packages under a folder called Python311 however, it was not installed under the site-packages folder in venv. I have no idea if this has anything to do with the issue but thought it might.
Now when I am trying to install requests-html, the install works fine, however, whenever I try to import requests_html, I get an error telling me that the package cannot be found. I did some digging through my files and found that it was installed under site packages under a folder called Python311 however, it was not installed under the site-packages folder in venv. I have no idea if this has anything to do with the issue but thought it might. The error message that Pycham displays 'No module named 'requests_html':3'. I have tried reinstalling the package to no luck.
following this guide: https://realpython.com/pypi-publish-python-package/
can I just create my Python package but not publish it to pypi.
just install it with pip install and then import my_packeg.
when trying this get No module named my_packeg error
the goal is to using this package code inside x micro service for prevent duplicate code...
From pip's user guide:
pip supports installing from PyPI, version control, local projects, and directly from distribution files.
The command-line to use is different:
There is a suitable command-line use for each of them and pip looks for, in the following order:
When looking at the items to be installed, pip checks what type of item each is, in the following order:
Project or archive URL.
Local directory (which must contain a setup.py, or pip will report an error).
Local file (a sdist or wheel format archive, following the naming conventions for those formats).
A requirement, as specified in PEP 440.
For your specific problem, you don't need to upload to PyPI. Solutions:
Build a "wheel" https://pip.pypa.io/en/stable/reference/pip_wheel/ and distribute that file, pip can install it.
Place a zip archive of the source somewhere on your intranet (or shared file system) and call pip install http://intranet.url/mypackage-1.0.4.zip
source: Can I make pip installable package without registering package in pypi?
Please seeking help from expert: When I am using pysyft library in python I am getting this error (
AttributeError: module 'syft' has no attribute 'TorchHook')
Here is my code screenshot
[1]: https://i.stack.imgur.com/rPxWw.png
my environment :
Spyder (Python IDE)
Ubuntu 20.04
python3
The version of syft you are using is v0.3.0+. It does not contain syft.TorchHook as I believe I read that it is not needed there.
Use pip install syft==0.2.9 to use syft.TorchHook(). Especially if you are following that Secure and Private Course from Andrew Trask, Openmined.
Note that if you are indeed following that course, a new updated course has been introduced by the Openmined team. See https://courses.openmined.org/courses/foundations-of-private-computation for more details. It is based on an updated version of syft.
I would like to add one additional issue: if you found the following problem when using PIP install syft==0.2.9
Could not find a version that satisfies the requirement torch~=1.4.0 (from syft) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
You can refer to the following methods to solve:
pip install syft -f https://download.pytorch.org/whl/torch_stable.html
Reason:
Not all PyTorch versions are available on Python's package registry PyPI.
-f : adding the custom registry
-f, --find-links <url>
If a URL or path to an html file, then parse for links to archives such as sdist (.tar.gz) or wheel (.whl) files. If a local path or file:// URL that’s a directory, then look for archives in the directory listing. Links to VCS project URLs are not supported.
refer to this link
I've tried to upload the xgboost python library to Azure ML, however it claim that my library is not a Win32 application.
I've made sure to install the 32 bit version of the package and i'm running conda 32 bit as well.
I downloaded the library from:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#xgboost
and chose the 32 bit python 3.5 version.
Python installation as below.
This is the error I get returned azure ml error
Here is my installation of anaconda conda installation
Can anyone see where I went wrong?
Best Regards
EDIT:
Yes I followed the document and uploaded a zip file containing the wheel file. When I run the following it works just fine:
"import pip" and "pip.main(['install', './Script Bundle/xgboost-0.6-cp35-cp35m-win32.whl'])"
But when I add "import xgboost" I get this error.Import error
According to your updated, it sounds like you had installed the xgboost wheel file successfully on Azure ML, but got an issue "ImportError: No module named xgboost" when using it.
As reference, there are two solutions which you can resolve the issue.
If you got the xgboost installed path from the result of installation via pip.main method, you can try to add the code as below to append the library path dynamically.
import os
import sys
sys.path.append(os.path.join(os.getcwd(), '<the installed path of xgboost>'))
Try to create a clean Python virtual environment via virtualenv, and do pip install xgboost or pip install xgboost.whl to get the dependencies into your site-packages directory on the new python virtual environment. And zipped the site-packages folder and uploaded as the Zip file, then included the reference to the site-packages directory and successfully imported the required items.
Hope it helps.
Update:
Try to download the xgboost wheel file and its dependencies from here, and decompress them to package the files in the wheel path like xgboost-0.6.data as a zip file to upload & use it as the script bundle.
I have a Python project that I want to get worked in Amazon aws Lambda. So i need to creat a deployment package. I tried it like explained on this page:
http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html
But here my problem:
Some Dependencies I can install, some are not installable.
If I want to install requests into a directory, It installs. If I want to install json into a directory I get the following error massage: Directory '/Users/iTom/Desktop/project-dir' is not installable. File 'setup.py' not found.
Dont know if this is important: I tried also to install json in general an got this error: Could not find a version that satisfies the requirement json (from versions: )
No matching distribution found for json
Thanks for help :)
EDIT: I got told json already included. What is with codecs and urllib?
json is a built-in package already shipped with python, you need not install it. Please see the python reference https://docs.python.org/2/library/json.html