Why did my pip download both the newest and the older version? - python-3.x

This is my first time to develop a PyPI package and ask a question on StackOverflow...
I'm developing a package named tttk. After I uploaded v1.0.0 and tried to install it, pip told me there's an error in setup.py. Then I changed setup.py, and rebuild, upload v1.0.1. When I try to install it again, the error appears again. I read everything in cmd, then I found that pip downloaded the package of v1.0.0 after it runs the setup.py of v1.0.1.
here's the screenshot of cmd when I tried to install v1.0.1.
I'm just trying to install tttk (the package I uploaded). Why is it soooo hard!?
I retried like this:pip install -v -v -v tttk...
here's everything I found that might be useful:
Skipping link: not a file: https://pypi.org/simple/tkinter/
Given no hashes to check 0 links for project 'tkinter': discarding no candidates
Created temporary directory: C:\Users\Len\AppData\Local\Temp\pip-unpack-sdbco3t1
Looking up "https://files.pythonhosted.org/packages/78/e2/748aaa5d447f3ff3b0e997cbafd8b0f8cead796b059b92514c83d6411f07/tttk-1.0.0.tar.gz" in the cache
Current age based on date: 4074
Ignoring unknown cache-control directive: immutable
Freshness lifetime from max-age: 365000000
The response is "fresh", returning cached response
365000000 > 4074
Using cached tttk-1.0.0.tar.gz (16 kB)
Added tttk from https://files.pythonhosted.org/packages/78/e2/748aaa5d447f3ff3b0e997cbafd8b0f8cead796b059b92514c83d6411f07/tttk-1.0.0.tar.gz to build tracker 'C:\\Users\\Len\\AppData\\Local\\Temp\\pip-build-tracker-6md7cbrk'
Running setup.py (path:C:\Users\Len\AppData\Local\Temp\pip-install-7f41cz28\tttk_c1fc2afbed064900bbc613a248233cca\setup.py) egg_info for package tttk
Created temporary directory: C:\Users\Len\AppData\Local\Temp\pip-pip-egg-info-3e78aanv
Running command python setup.py egg_info
Traceback (most recent call last):
File "<string>", line 36, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\Len\AppData\Local\Temp\pip-install-7f41cz28\tttk_c1fc2afbed064900bbc613a248233cca\setup.py", line 4, in <module>
with open("./README.md", "r",encoding='utf-8') as fh:
FileNotFoundError: [Errno 2] No such file or directory: './README.md'
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
full command: 'D:\Python37\python.exe' -c '
exec(compile('"'"''"'"''"'"'
# This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
...

SOLVED
First, thanks to every reply...
I'm not an English speaker, and I wrote this without any help from translation software, so if you can't understand what I'm talking about, just read the last paragraph to find out the main reason and how did it caused the problem...
Maybe I forgot to write this in my question. In fact, I have already fixed the README.MD not found problem in v1.0.1 (and newer), but v1.0.0 still has this bug. pip downloaded both v1.0.1 and 1.0.0 so this error appears again.
The output in my question is just a part of all of them...
I went to pypi.org and yank every older versions (v1.0.0 and v0.1.0), then retried, and seems pip couldn't find tkinter. And here's what I've got:
screenshot again
The main reason of this problem is I wrote tkinter in requirements.txt (remember this is my first time to develop a PyPI package). pip couldn't found tkinter on its server ,so it tried to install the older version automatically. But the README file not found problem is still exists in the older version, so that's why it failed...

Related

I Tried to Install PyQtWebEngine, Always Stuck on the Same Problem. Couldn't Fine the solution anywhere [duplicate]

This question already has an answer here:
Why python executable opens new window instance when function by multiprocessing module is called on windows
(1 answer)
Closed 3 years ago.
I'm new to this. Sorry for the mess.
I've been trying to install PyQtWebEngin, first On zorin os which is dualboot along with Windows10, it failed. Then I decided to install it on Linux Mint on VM inside Windows10. The error result is alway the same.
Here take a look,
poo#poo:~/Downloads$ pip3 install PyQtWebEngine
Collecting PyQtWebEngine
Using cached https://files.pythonhosted.org/packages/71/be/cd5243a456aae37788eebd8333d2326fd830de7ce1f1ac6618e966a66862/PyQtWebEngine-5.14.0-5.14.0-cp35.cp36.cp37.cp38-abi3-manylinux1_x86_64.whl
Collecting PyQt5-sip<13,>=12.7 (from PyQtWebEngine)
Using cached https://files.pythonhosted.org/packages/69/d2/92d85b0865fe68755488a30eec1c2b1b14da6c96c74441dc1c88e0659397/PyQt5_sip-12.7.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting PyQt5>=5.14 (from PyQtWebEngine)
Using cached https://files.pythonhosted.org/packages/3a/fb/eb51731f2dc7c22d8e1a63ba88fb702727b324c6352183a32f27f73b8116/PyQt5-5.14.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.6/tokenize.py", line 452, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-build-3tqr21z4/PyQt5/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-3tqr21z4/PyQt5/
Can you guys help me out.
Thanks in advance.
Your pip seems to be trying to use a source distribution of PyQt5 for installation, but it seems that setup.py is missing from the .tar.gz on pypi, which is odd.
According to the docs installing from source is not recommended anyway
However using pip to install from the source package is not recommended
I do not know why your pip chose to download the .tar.gz in the first place. Looking at the other whl files from you log with cp36-cp36m-manylinux1_x86_64.whl, there is a PyQt5-5.14.1-5.14.0-cp35.cp36.cp37.cp38-abi3-manylinux2014_x86_64.whl on pypi that should be compatible with your system and should be the first choice of pip for downloading.
You can try to do it manually:
wget https://files.pythonhosted.org/packages/ea/9d/d609aab4111d9d74857fb73067f7de4ca38fc1f7fff87ceba092681754cf/PyQt5-5.14.1-5.14.0-cp35.cp36.cp37.cp38-abi3-manylinux2014_x86_64.whl
pip install PyQt5-5.14.1-5.14.0-cp35.cp36.cp37.cp38-abi3-manylinux2014_x86_64.whl
And then try your installation again

pip failed with error code 1 while installing pyzmail

I'm trying to send Gmail through python3. I can use the email and smptlib, but I wanted to try out pyzmail.
However, when I try to install pyzmail, I get this:
$ pip3 install pyzmail
Collecting pyzmail
Using cached https://files.pythonhosted.org/packages/23/9a/c8709821fa15cec44f825fba884284b261a06d8a0033a16f4c35470eb26a/pyzmail-1.0.3.tar.gz
Collecting distribute (from pyzmail)
Using cached https://files.pythonhosted.org/packages/5f/ad/1fde06877a8d7d5c9b60eff7de2d452f639916ae1d48f0b8f97bf97e570a/distribute-0.7.3.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/dist.py", line 7, in <module>
from setuptools.command.install import install
File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/command/__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/command/install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/pkg_resources.py", line 1518, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/
I tested installing a different pip module but everything seemed to be in order.
I also tried easy_install but it installed for python 2.7, and not 3.
I think it might be something about my setuptools, but I don't know what needs to be done.
The pyzmail packages seems to be inactive now as the last commit and the last release were made 4 years ago. It does not seem to be updated for Python 3.6+.
There was an issue posted on the package's github page with the same error as yours: https://github.com/aspineux/pyzmail/issues/15. Someone posted a patch as a workaround but the best solution is to use pyzmail36 instead:
Tagging #cfenollosa #GheloAce in case you're still using this library
and are looking for a more maintainable way forward.
This repository unfortunately seems inactive, so I created a new
package on PyPI that includes all the fixes to make pyzmail
pip-installable on Python 3.6.
The name of the new package is pyzmail36. You can just update your
requirements.txt file to list pyzmail36 instead of pyzmail and all of
the rest of your code shouldn't need to change.
So just try with:
pip3 install pyzmail36
There are several ways to install pyzmail such as:
Try to use " pip install pyzmail36" by installing Python 3.6 first on your device.
Try to update the setup-tools by typing "pip install setuptools==20.1.1" and then install pyzmail.
Try to search for easy_install on Python 3.x, I have found several links for that.
Good luck.

ModuleNotFoundError in Anaconda3 when installing package with pip

I'm running conda 4.4.8 on mac OS 10.11.16 and I'm trying to properly install a third-party package that I have as a tar.gz file. The package installation seems to work without any issue (having already tried to install, this in what I get when I run it again):
$: pip install ~/Downloads/pydelay-0.1.1.tar.gz
Processing ~/Downloads/pydelay-0.1.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): pydelay==0.1.1 from file://~/Downloads/pydelay-0.1.1.tar.gz in ~/anaconda3/lib/python3.6/site-packages
Building wheels for collected packages: pydelay
Running setup.py bdist_wheel for pydelay ... done
Stored in directory: ~/Library/Caches/pip/wheels/5d/b7/4e/3896677f80cccebfc2d300904aca54ebbd6b0885cb9440e13d
Successfully built pydelay
Then I do a check to make sure there aren't dependencies missing:
$: pip check pydelay
No broken requirements found.
However, when I run my piece of code that uses the package, I get the following error:
runfile('~/.../DDEin3+1D.py', wdir='~/...')
Traceback (most recent call last):
File "ipython-input-16-12e8207a0dca", line 1, in
runfile('~/.../DDEin3+1D.py', wdir='~/...')
File "~/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 710, in runfile
execfile(filename, namespace)
File "~/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 101, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "~/.../DDEin3+1D.py", line 18, in
from pydelay import dde23
File "~/anaconda3/lib/python3.6/site-packages/pydelay/__init__.py", line 9, in
from _dde23 import dde23
ModuleNotFoundError: No module named '_dde23'
I don't think its a version problem, but because the pydelay package is from 2009 it very well could be.
Any help with getting the spyder editor (or command line python) to find this package would be greatly appreciated!
pythonanaconda3
Just in case anyone runs into something like this, I thought I would post the solution. In this instance, the __init__.py file was searching my default PATH for _dde23, which was actually located in the same directory as __init__.py. The solution was simply to change the import call in __init__.py to
from ._dde23 import dde23
This told the file to look within the same directory for the module. I found similar problems throughout the package, and with this small change solved them all. I'm not an expert, but it might have been something to do with pydelay being built with python2.x while I was running python3.x.
Of course, getting other parts of this module to work with depreciated dependencies is another matter ;)

python-escpos windows giving "bugtrack_url" error

Trying to install python-escpos library. The instructions say the following:
Ensure the library is installed on ${lib_arch}/${python_ver}/site-packages/escpos
On CLi you must run:
python setup.py build
sudo python setup.py install
What does ${lib_arch}/${python_ver}/ mean? Is it the path such as
\Users\RickT\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\escpos?
When I run python setup.py build, I get the following error:
C:\Users\RickT\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'bugtrack_url' warnings.warn(msg)Traceback (most recent call last):
File "setup.py", line 140, in <module> 'python-escpos = escpos.cli:main'
As I wrote in the comments you should write which version of the documentation you are using and which version of the codebase you are using.
The "error" considering the bugtrack_url is just a warning because setuptools does not know this token. This should not affect your setup in any way. You probably installed it successfully.
Concerning your question about the path: ${lib_arch}/${python_ver}/site-packages/escpos is more or less non-sense in a Windows-context. This just means your location of the site-packages-directory. So, your assumption is right.
All in all the probably easiest solution for you would be installing with pip. This would simply be - considering you have a working pip - a one-liner:
pip install python-escpos

Using virtualenv with python3 in openSuSE

I am experiencing a problem when using virtualenv in openSuSE 12.3 with Python3:
I installed the python3 and python3-devel packages.
Then I installed the newest distribute and pip and finally virtualenv using pip.
When I try to create a virtualenv I get the following error:
$ virtualenv-3.3 venv01
Using base prefix '/usr'
New python executable in venv01/bin/python3.3
Also creating executable in venv01/bin/python
Installing distribute.........................................................................................................................................................................................................................................................................................................................................................................................................done.
Installing pip....
Complete output from command /home/user/venv01/bin/python3.3 -x /home/user/venv01/bin/easy_install /usr/local/lib/pytho...ort/pip-1.3.1.tar.gz:
/home/user/venv01/bin/python3.3: can't open file '/home/user/venv01/bin/easy_install': [Errno 2] No such file or directory
----------------------------------------
...Installing pip...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv-3.3", line 9, in <module>
load_entry_point('virtualenv==1.9.1', 'console_scripts', 'virtualenv-3.3')()
File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 979, in main
no_pip=options.no_pip)
File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 1094, in create_environment
install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 667, in install_pip
filter_stdout=_filter_setup)
File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 1057, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/user/venv01/bin/python3.3 -x /home/user/venv01/bin/easy_install /usr/local/lib/pytho...ort/pip-1.3.1.tar.gz failed with error code 2
Running it with -vvv yields some interesting output that shows that distribute
is extracted to <venv>/local/lib/python3.3/site-packages/.
I wonder why distribute is not installed into <venv>/lib/python3.3/site-packages/?
Does anyone have an idea why this happens and how I can use virtualenv in
openSuSE without compiling python3 myself?
[now fixed in latest patches from opensuse]
[oh! i just realised you are the same person as the original link. sorry. but i will leave this as it is a top result for google search on this issue (was searching myself for any update) so it may help others.]
this is a known issue, discussed at https://forums.opensuse.org/english/get-technical-help-here/applications/484475-using-virtualenv-python-3-a.html and with an open bug at https://bugzilla.novell.com/show_bug.cgi?id=809831
the only work-around i know of is to install everything yourself. it's not so hard, and i describe what is necessary at http://www.acooke.org/cute/GettingPyt0.html
basically:
install python 3.3 from source (do an "altinstall" to install as /usr/local/bin/python3.3)
fix the lib issue (link lib_dynload from /usr/local/lib64/python3.3 to /usr/local/lib/python3.3)
install distutils
install virtualenv
then you can use python3.3 and virtual-env-3.3 etc as expected.

Resources