qscintilla python binding issue - python

Attempting to follow the QSCintilla instructions re Python bindings for PyQT5
Python Bindings
The Python bindings are in the Python directory. You must have either PyQt v4 or v5 already installed. QScintilla must also already be built and installed.
The configure, build and install the bindings for PyQt v4, run:
python configure.py
make
make install On Windows (and depending on the compiler you are using) you may need to run nmake rather than make.
If you want to build the bindings for PyQt v5 then pass –pyqt=PyQt5 as an argument to configure.py.
But when I run the below command it complains about PyQt5 not being installed
python configure.py --qmake=/users/marklloyd/Qt/5.8/clang_64/bin/qmake --pyqt=PyQt5
Error: Unable to import PyQt5.QtCore. Make sure PyQt5 is installed
If I run brew info I can see the dependency is OK
brew info qscintilla2
qscintilla2: stable 2.10 (bottled) Port to Qt of the Scintilla editing component https://www.riverbankcomputing.com/software/qscintilla/intro /usr/local/Cellar/qscintilla2/2.10 (135 files, 6.9MB) * Poured from bottle on 2017-03-21 at 13:54:46 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/qscintilla2.rb
==> Dependencies Required: qt5 ✔, sip --with-python3 ✔, pyqt5 ✔
==> Requirements Recommended: python3 ✔ Optional: python ✔
==> Options
--with-plugin Build the Qt Designer plugin
--with-python Build Python bindings
--without-python3 Do not build Python3 bindings
this is OSX 10.12.3 FYI and I am more than happy to admit I'm not an expert at this level of stuff at all.
I'm trying to get QScintilla working so I can get PyMakr from Pycom installed and working
Pymakr-master marklloyd$ python install.py
Checking dependencies
Python Version: 2.7.12
Found PyQt5
Found pyuic5
Sorry, please install QScintilla2 and
its PyQt5/PyQt4 wrapper.
Error: cannot import name Qsci
Anyone else suffered similar issues?
To answer Barrys comment
pip3 install QScintilla returns
Requirement already satisfied:
QScintilla in /Library/Frameworks/Python.framework/Versions/3.6/lib/python‌​3.6/site-packages
Requirement already satisfied: PyQt5>=5.7.1 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python‌​3.6/site-packages (from QScintilla)
Requirement already satisfied: sip<4.20,>=4.19 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python‌​3.6/site-packages (from PyQt5>=5.7.1->QScintilla)
pip3 install pyqt5
Requirement already satisfied: pyqt5 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Requirement already satisfied: sip<4.20,>=4.19 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from pyqt5)

Related

Problem when download Python package and then install from .whl files

I want to download Python package pipy.org and move them to another machine and finally install that packages with downloaded .whl files in that machine
This is requirements.txt file:
amqp==5.1.1
anytree==2.8.0
asgiref==3.5.2
async-timeout==4.0.2
attrs==22.1.0
autobahn==22.7.1
Automat==22.10.0
beautifulsoup4==4.11.1
billiard==3.6.4.0
celery==5.2.7
certifi==2022.9.24
cffi==1.15.1
channels==4.0.0
channels-redis==4.0.0
charset-normalizer==2.1.1
click==8.1.3
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
constantly==15.1.0
coreapi==2.3.3
coreschema==0.0.4
cryptography==38.0.3
daphne==4.0.0
Deprecated==1.2.13
Django==4.0.8
django-celery-beat==2.3.0
django-celery-results==2.4.0
django-filter==22.1
django-jalali==6.0.0
django-timezone-field==5.0
djangorestframework==3.14.0
djangorestframework-simplejwt==5.2.2
drf-yasg==1.21.4
et-xmlfile==1.1.0
gunicorn==20.1.0
h2==4.1.0
hpack==4.0.0
hyperframe==6.0.1
hyperlink==21.0.0
idna==3.4
incremental==22.10.0
inflection==0.5.1
itypes==1.2.0
jdatetime==4.1.0
Jinja2==3.1.2
kombu==5.2.4
lxml==4.9.1
MarkupSafe==2.1.1
msgpack==1.0.4
multitasking==0.0.11
numpy==1.23.3
openpyxl==3.0.10
packaging==21.3
pandas==1.5.0
pandas-datareader==0.10.0
Pillow==9.2.0
priority==1.3.0
prompt-toolkit==3.0.31
psutil==5.9.2
psycopg2==2.9.4
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.21
PyJWT==2.6.0
pyOpenSSL==22.1.0
pyparsing==3.0.9
python-crontab==2.6.0
python-dateutil==2.8.2
python-dotenv==0.21.0
pytz==2022.4
redis==4.3.4
requests==2.28.1
ruamel.yaml==0.17.21
ruamel.yaml.clib==0.2.7
service-identity==21.1.0
simplejson==3.17.6
six==1.16.0
soupsieve==2.3.2.post1
sqlparse==0.4.3
Twisted==22.10.0
txaio==22.2.1
typing_extensions==4.4.0
tzdata==2022.5
Unidecode==1.3.6
uritemplate==4.1.1
urllib3==1.26.12
vine==5.0.0
wcwidth==0.2.5
wrapt==1.14.1
yfinance==0.1.74
zope.interface==5.5.1
I did download packages with:
pip download -r requirements.txt
This is list of downloaded pacakges in ~/LocalPythonPackage directory:
→ ls
amqp-5.1.1-py3-none-any.whl lxml-4.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
anytree-2.8.0-py2.py3-none-any.whl MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
asgiref-3.5.2-py3-none-any.whl msgpack-1.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
async_timeout-4.0.2-py3-none-any.whl multitasking-0.0.11-py3-none-any.whl
attrs-22.1.0-py2.py3-none-any.whl numpy-1.23.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
autobahn-22.7.1.tar.gz openpyxl-3.0.10-py2.py3-none-any.whl
Automat-22.10.0-py2.py3-none-any.whl packaging-21.3-py3-none-any.whl
beautifulsoup4-4.11.1-py3-none-any.whl pandas-1.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
billiard-3.6.4.0-py3-none-any.whl pandas_datareader-0.10.0-py3-none-any.whl
celery-5.2.7-py3-none-any.whl Pillow-9.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
certifi-2022.9.24-py3-none-any.whl priority-1.3.0-py2.py3-none-any.whl
cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl prompt_toolkit-3.0.31-py3-none-any.whl
channels-4.0.0-py3-none-any.whl psutil-5.9.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
channels_redis-4.0.0-py3-none-any.whl psycopg2-2.9.4.tar.gz
charset_normalizer-2.1.1-py3-none-any.whl pyasn1-0.4.8-py2.py3-none-any.whl
click-8.1.3-py3-none-any.whl pyasn1_modules-0.2.8-py2.py3-none-any.whl
click_didyoumean-0.3.0-py3-none-any.whl pycparser-2.21-py2.py3-none-any.whl
click_plugins-1.1.1-py2.py3-none-any.whl PyJWT-2.6.0-py3-none-any.whl
click_repl-0.2.0-py3-none-any.whl pyOpenSSL-22.1.0-py3-none-any.whl
constantly-15.1.0-py2.py3-none-any.whl pyparsing-3.0.9-py3-none-any.whl
coreapi-2.3.3-py2.py3-none-any.whl python-crontab-2.6.0.tar.gz
coreschema-0.0.4.tar.gz python_dateutil-2.8.2-py2.py3-none-any.whl
cryptography-38.0.3-cp36-abi3-manylinux_2_28_x86_64.whl python_dotenv-0.21.0-py3-none-any.whl
daphne-4.0.0-py3-none-any.whl pytz-2022.4-py2.py3-none-any.whl
Deprecated-1.2.13-py2.py3-none-any.whl redis-4.3.4-py3-none-any.whl
Django-4.0.8-py3-none-any.whl requests-2.28.1-py3-none-any.whl
django_celery_beat-2.3.0-py3-none-any.whl ruamel.yaml-0.17.21-py3-none-any.whl
django_celery_results-2.4.0-py3-none-any.whl ruamel.yaml.clib-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
django_filter-22.1-py3-none-any.whl service_identity-21.1.0-py2.py3-none-any.whl
django_jalali-6.0.0-py3-none-any.whl setuptools-65.6.3-py3-none-any.whl
djangorestframework-3.14.0-py3-none-any.whl simplejson-3.17.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
djangorestframework_simplejwt-5.2.2-py3-none-any.whl six-1.16.0-py2.py3-none-any.whl
django_timezone_field-5.0-py3-none-any.whl soupsieve-2.3.2.post1-py3-none-any.whl
drf_yasg-1.21.4-py3-none-any.whl sqlparse-0.4.3-py3-none-any.whl
et_xmlfile-1.1.0-py3-none-any.whl Twisted-22.10.0-py3-none-any.whl
gunicorn-20.1.0-py3-none-any.whl txaio-22.2.1-py2.py3-none-any.whl
h2-4.1.0-py3-none-any.whl typing_extensions-4.4.0-py3-none-any.whl
hpack-4.0.0-py3-none-any.whl tzdata-2022.5-py2.py3-none-any.whl
hyperframe-6.0.1-py3-none-any.whl Unidecode-1.3.6-py3-none-any.whl
hyperlink-21.0.0-py2.py3-none-any.whl uritemplate-4.1.1-py2.py3-none-any.whl
idna-3.4-py3-none-any.whl urllib3-1.26.12-py2.py3-none-any.whl
incremental-22.10.0-py2.py3-none-any.whl vine-5.0.0-py2.py3-none-any.whl
inflection-0.5.1-py2.py3-none-any.whl wcwidth-0.2.5-py2.py3-none-any.whl
itypes-1.2.0-py2.py3-none-any.whl wrapt-1.14.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
jdatetime-4.1.0-py3-none-any.whl yfinance-0.1.74-py2.py3-none-any.whl
Jinja2-3.1.2-py3-none-any.whl zope.interface-5.5.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
and after copy all `.whl files to traget computer, I did run this code:
pip install --no-index --find-links ~/LocalPythonPackage -r requirements.txt
But I got this error:
ERROR: Could not find a version that satisfies the requirement MarkupSafe==2.1.1 (from versions: none)
ERROR: No matching distribution found for MarkupSafe==2.1.1
I use python3.11 and Ubuntu 20.04.5 LTS in both computers. I think that, this problem is for dependencies or different in OS.
Can you help me to solve this problem?
TL;DR
You need to use --platform and --only-binary=:all: (sometimes need to specify --abi and --python-version as well) flags to download wheels that is compatible with your installation target machine.
pip3 download --only-binary=:all: --platform manylinux2014_aarch64 -r requirements.txt
(Important: if your target machine is not aarch64 architecture, replace the manylinux2014_aarch64 with the correct platform tag)
Some wheels are platform dependent
The error happens because pip can't install the MarkupSafe wheel you provided in the directory, therefore it says it can't find a valid distribution.
Since you mentioned the two computers are same in Python version and OS distribution, I'm gonna guess that the two computers you use are different in architectures. (ex. the target computer is aarch64)
The following explanation and solution are based on this guess.
The Python Packaging User Guide states a Python wheel could be either a "pure Python wheel" or a "platform wheel". When a Python package contains extensions that requires compilation, the produced wheel will be platform-specific and cannot be installed on other non-compatible platforms.
In your case, the wheel MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl is a platform wheel built for Python 3.10 runtime, manylinux2014 and x86_64 architecture machines.
The wheel filename is defined in PEP 491, formatted as {distribution}-{version}(-{build tag})?-{python tag}-{abi tag}-{platform tag}.whl.
The last three components of the filename before the extension are called “compatibility tags.” The compatibility tags express the package’s basic interpreter requirements and are detailed in PEP 425.
Hence by the name of a wheel (to be precise, the last three component in the filename) you can find out if it is a pure Python wheel or a platform wheel.
Newer Python versions (except different major versions) can still install platform wheels built for older minor versions
Another answer in the post says you need to install a wheel that has the same miner Python version in the Python tag, but that is usually not true.
According to PEP 425:
The tags are used by installers to decide which built distribution (if any) to download from a list of potential built distributions. The installer maintains a list of (pyver, abi, arch) tuples that it will support. If the built distribution’s tag is in the list, then it can be installed.
That means pip is responsible for make decision whether a distribution could be installed on the current system.
Let's take a look at the source code of pip. The CandidateEvaluator evaluate possible distribution candidates when trying to install a package.
If you trace the code all the way to _py_interpreter_range, you'll find out a list of older Python minor versions are appended to the supported tags in descending order.
For Python 3.11, Python 3.10, Python 3.9, Python 3.8... are all considered supported tags for pip.
Solution
pip download with the --platform, --python-version, --implementation, and --abi options provides the ability to fetch dependencies for an interpreter and system other than the ones that pip is running on. --only-binary=:all: or --no-deps is required when using any of these options.
from https://pip.pypa.io/en/stable/cli/pip_download/.
To download MarkupSafe for manylinux2014_aarch64:
$ pip3 download --only-binary=:all: --platform manylinux2014_aarch64 MarkupSafe
And change your package preparation command to:
pip3 download --only-binary=:all: --platform manylinux2014_aarch64 -r requirements.txt
You use Python 3.11 but wheels you show above are for Python 3.10. You should download packages on a host with the same processor architecture (x64 seems to be your case), the same OS and version (Ubuntu 20) and the same minor Python version (Python 3.11.*, that is any Python 3.11 does but not Python 3.10) as the target host.
Or use Python 3.10 on the offline host.

qt6 designer in python [duplicate]

Feeling really stupid, right now, but the title says it all:
How do you start the QtDesigner?
I've installed PyQt5 via pip and I believe to have identified the directory it's been installed in as
C:\Users\%username%\AppData\Local\Programs\Python\Python36\Lib\site-packages\PyQt5
Now what? There are a lot of .pyd files, some .dll's, too, but nothing executable (well, except a QtWebEngineProcess.exe in ...\site-packages\PyQt5\Qt\bin, but that doesn't sound like what I'm looking for.
I struggled with this as well. The pyqt5-tools approach is cumbersome so I created a standalone installer for Qt Designer. It's only 40 MB. Maybe you will find it useful!
If you are working in python virtual environment, in the command window
>>qt5-tools designer
can open designer window.
The latest PyQt5 wheels (which can be installed via pip) only contain what's necessary for running applications, and don't include the dev tools. This applies to PyQt versions 5.7 and later. For PyQt versions 5.6 and earlier, there are binary packages for Windows that also include the dev tools, and these are still available at sourceforge. The maintainer of PyQt does not plan on making any further releases of such binary packages, though - only the runtime wheels will now be made available, and there will be no official wheels for the dev tools.
In light of this, someone has created an unofficial pyqt5-tools wheel (for Windows only). This appears to be in it's early stages, though, and so may not keep up with recent PyQt5 releases. This means that it may not always be possible to install it via pip. If that is the case, as a work-around, the wheel files can be treated as zip files and the contents extracted to a suitable location. This should then allow you to run the designer.exe file that is in the pyqt5-tools/designer folder.
Finally, note that you will also see some zip and tar.gz files at sourceforge for PyQt5. These only contain the source code, though, so will be no use to you unless you intend to compile PyQt5 yourself. And just to be clear: compiling from source still would not give you all the Qt dev tools. If you go down that route, you would need to install the whole Qt development kit separately as well (which would then get you the dev tools).
The Qt designer is not installed with the pip installation.
You can either download the full download from sourceforge (probably won't be the last pyqt release, and might be buggy on presence of another installation, like yours) or install it with another (unofficial) pypi package - pyqt5-tools (pip install pyqt5-tools), then run the designer from the following subpath of your python directory -
...\Python36\Lib\site-packages\pyqt5-tools\designer\designer.exe
pip install pyqt5-tools
Then restart the cmd, just type "designer" and press enter.
If you cannot see the Designer , just look into this path "Lib\site-packages\qt5_applications\Qt\bin" for designer.exe and run it.
PyQt5 works after pip install PyQt5Designer
pip install pyqt5-tools
working in python 3.7.4
wont work in python 3.8.0
You can also install Qt Designer the following way:
Install latest Qt (I'm using 5.8) from Qt main site
Make sure you include "Qt 5.8 MinGW" component
Qt Designer will be installed in C:\Qt\5.8\mingw53_32\bin\designer.exe
Note that the executable is named "designer.exe"
For anyone stumbling across this post in 2021+ and finding the answers outdated: QT Designer is now in the qt5-applications package, under Qt\bin\. On Windows this means the default path, for CPython 3.9 using the Python.org installer, is %APPDATA%\Python\Python39\site-packages\qt5_applications\Qt\bin\designer.exe.
Download the module using pip:
pip install PyQt5Designer
Then, for anaconda users, open:
C:\ProgramData\AnacondaX\Lib\site-packages\QtDesigner\designer.exe
For python users:
64-bit:
C:\Program Files\PythonXX\Lib\site-packages\QtDesigner\designer.exe
32-bit:
C:\Program Files (x86)\PythonXX\Lib\site-packages\QtDesigner\designer.exe
Try using:
pip install pyqt5-tools
Now you'd find the designer in site-packages/pyqt5-tools.
If you are installing the pyqt5-tools then you can find the designer.exe file inside:
<python_installation>\Lib\site-packages\Qt
If you cannot locate the file or have any issues opening this directly, then open a command prompt and type:
<python_installation>\Scripts\pyqt5designer.exe
For Qt Designer 6 this worked for me thanks for that protip from #Bhaskar
pip install pyqt6-tools
Then started:
qt6-tools designer
End up with nice working lightweight Qt Designer 6.0.1 version
# pip install pyqt6-tools
Collecting pyqt6-tools
Using cached pyqt6_tools-6.1.0.3.2-py3-none-any.whl (29 kB)
Collecting pyqt6-plugins<6.1.0.3,>=6.1.0.2.2
Downloading pyqt6_plugins-6.1.0.2.2-cp39-cp39-manylinux2014_x86_64.whl (77 kB)
|████████████████████████████████| 77 kB 492 kB/s
Collecting python-dotenv
Using cached python_dotenv-0.19.2-py2.py3-none-any.whl (17 kB)
Collecting pyqt6==6.1.0
Downloading PyQt6-6.1.0-cp36.cp37.cp38.cp39-abi3-manylinux_2_28_x86_64.whl (6.8 MB)
|████████████████████████████████| 6.8 MB 1.0 MB/s
Requirement already satisfied: click in ./.pyenv/versions/3.9.6/lib/python3.9/site-packages (from pyqt6-tools) (8.0.1)
Collecting PyQt6-sip<14,>=13.1
Downloading PyQt6_sip-13.2.0-cp39-cp39-manylinux1_x86_64.whl (307 kB)
|████████████████████████████████| 307 kB 898 kB/s
Collecting PyQt6-Qt6>=6.1.0
Using cached PyQt6_Qt6-6.2.2-py3-none-manylinux_2_28_x86_64.whl (50.0 MB)
Collecting qt6-tools<6.1.0.2,>=6.1.0.1.2
Downloading qt6_tools-6.1.0.1.2-py3-none-any.whl (13 kB)
Collecting click
Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
|████████████████████████████████| 82 kB 381 kB/s
Collecting qt6-applications<6.1.0.3,>=6.1.0.2.2
Downloading qt6_applications-6.1.0.2.2-py3-none-manylinux2014_x86_64.whl (80.5 MB)
|████████████████████████████████| 80.5 MB 245 kB/s
Installing collected packages: qt6-applications, PyQt6-sip, PyQt6-Qt6, click, qt6-tools, pyqt6, python-dotenv, pyqt6-plugins, pyqt6-tools
Attempting uninstall: click
Found existing installation: click 8.0.1
Uninstalling click-8.0.1:
Successfully uninstalled click-8.0.1
Successfully installed PyQt6-Qt6-6.2.2 PyQt6-sip-13.2.0 click-7.1.2 pyqt6-6.1.0 pyqt6-plugins-6.1.0.2.2 pyqt6-tools-6.1.0.3.2 python-dotenv-0.19.2 qt6-applications-6.1.0.2.2 qt6-tools-6.1.0.1.2
you should find it here if your using anaconda
C:\Users\%username%\anaconda3\envs\untitled\Lib\site-packages\qt5_applications\Qt\bin
By far the easiest way to do this is to use this installer:
https://build-system.fman.io/qt-designer-download
It seems as though the other answers here are now out of date, not to mention confusing for someone who is just starting out with this. Sourceforge no longer has this package, I installed the tools as suggested but nothing appeared in the scripts folder, and none of the pip commands above worked either.
I was having the same problem, however I was able to install using the Pygame module installation code, changing some information:
pygame:
py -m pip install -U pygame --user
PyQt5:
py -m pip install -U pyqt5-tools --user
In a Windows' terminal, activate your virtual env where you have installed PyQt5 then just type designer.
You can create a shortcut by finding its path with where designer

Can pypoetry install only the dependency that I ask it to add?

When running poetry add package, poetry decides to update some out of date dependencies without my asking:
$ poetry add -D ipython
Using version ^7.26.0 for ipython
Updating dependencies
Resolving dependencies... (6.8s)
Writing lock file
Package operations: 13 installs, 2 updates, 0 removals
• Installing ipython-genutils (0.2.0)
• Installing parso (0.8.2)
• Installing ptyprocess (0.7.0)
• Installing traitlets (5.0.5)
• Installing wcwidth (0.2.5)
• Installing appnope (0.1.2)
• Installing backcall (0.2.0)
• Updating connexion (2.8.0 -> 2.9.0) <---------- "I never asked for this"
• Installing jedi (0.18.0)
• Installing matplotlib-inline (0.1.2)
• Installing pexpect (4.8.0)
• Installing pickleshare (0.7.5)
• Installing prompt-toolkit (3.0.19)
• Installing ipython (7.26.0)
• Updating ramda (0.6.0 -> 0.6.1) <---------- "I never asked for this"
And yet when getting the help for the command, there doesn't seem to be anything that suggest that it's possible to disable this behaviour:
$ poetry add --help
USAGE
poetry add [-D] [-E <...>] [--optional] [--python <...>]
[--platform <...>] [--source <...>] [--allow-prereleases]
[--dry-run] [--lock] <name1> ... [<nameN>]
ARGUMENTS
<name> The packages to add.
OPTIONS
-D (--dev) Add as a development dependency.
-E (--extras) Extras to activate for the dependency.
(multiple values allowed)
--optional Add as an optional dependency.
--python Python version for which the dependency must be
installed.
--platform Platforms for which the dependency must be
installed.
--source Name of the source to use to install the
package.
--allow-prereleases Accept prereleases.
--dry-run Output the operations but do not execute
anything (implicitly enables --verbose).
--lock Do not perform operations (only update the
lockfile).
GLOBAL OPTIONS
-h (--help) Display this help message
-q (--quiet) Do not output any message
-v (--verbose) Increase the verbosity of messages: "-v" for
normal output, "-vv" for more verbose output and
"-vvv" for debug
-V (--version) Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n (--no-interaction) Do not ask any interactive question
...
Any way to install only the package of interest?
I prefer not to update deps, even if the bump is a minor bump - dependabot exists for this purpose already.

deployment with fabric issues

Hello I have trouble understanding packages manager such as apt pip pip3
I am trying to automate shell command with the use of fabric3 library
I am following a book which tells me to write the following shell command pip install fabric3
My fabfile.py contains f-strings which are working on python3 only
when I do pip list I see Fabric3 (1.14.post1) so I am assuming that the package is successfully installed, yet when I run my fab, I get fab not found, and command line is telling me to sudo apt install fabric
But doing so is useless, because fabric is working only with python2.7
Basically I have thought of two possible solutions to my problem :
1- Trying to make the fab command to use python3.6 instead of python2.7 ? But I don't know how to do that ...
2- Deleting Fabric, and keeping Fabric3, but for some reason, I get this 'fab' not found and I don't understand why
I have read the documentation but It is really obscur, I find no answer to my issue
Any help will be greatly appreciated,
Thanks
Update1:
So when I run pip list
asn1crypto (0.24.0)
attrs (17.4.0)
Automat (0.6.0)
bcrypt (3.1.7)
blinker (1.4)
certifi (2018.1.18)
cffi (1.13.2)
chardet (3.0.4)
click (6.7)
cloud-init (19.2)
colorama (0.3.7)
command-not-found (0.3)
configobj (5.0.6)
constantly (15.1.0)
cryptography (2.8)
distro-info (0.18ubuntu0.18.04.1)
Fabric3 (1.14.post1)
httplib2 (0.9.2)
hyperlink (17.3.1)
idna (2.6)
incremental (16.10.1)
Jinja2 (2.10)
jsonpatch (1.16)
jsonpointer (1.10)
jsonschema (2.6.0)
keyring (10.6.0)
keyrings.alt (3.0)
language-selector (0.1)
MarkupSafe (1.0)
netifaces (0.10.4)
oauthlib (2.0.6)
PAM (0.4.2)
paramiko (2.7.1)
pip (9.0.1)
pyasn1 (0.4.2)
pyasn1-modules (0.2.1)
pycparser (2.19)
pycrypto (2.6.1)
pygobject (3.26.1)
PyJWT (1.5.3)
PyNaCl (1.3.0)
pyOpenSSL (17.5.0)
pyserial (3.4)
python-apt (1.6.4)
python-debian (0.1.32)
pyxdg (0.25)
PyYAML (3.12)
requests (2.18.4)
requests-unixsocket (0.1.5)
SecretStorage (2.3.1)
service-identity (16.0.0)
setuptools (39.0.1)
six (1.13.0)
ssh-import-id (5.7)
systemd-python (234)
Twisted (17.9.0)
ufw (0.36)
unattended-upgrades (0.1)
urllib3 (1.22)
wheel (0.30.0)
zope.interface (4.3.2)
Fabric3 is correctly installed
Then, I run this command to deploy my code on server :
fab deploy:host=xxx#yyy
where xxx is username
and yyy is domain name
I get the following error : Command 'fab' not found, but can be installed with: sudo apt install fabric
NOTE: I tried this command update-alternatives --install /usr/bin/python python /usr/bin/python3.6 10
found on this topic Unable to set default python version to python3 in ubuntu
and which python stills points to /usr/bin/python
I have found that I have /usr/bin/python3.6
Do you think if I manage to have the which python pointing to /usr/bin/python3.6 my issue will be solved?
First of all fabric3 is unauthorized fork of fabric as stated here:
unfortunately, the fabric3 entry on PyPI is an unauthorized fork of
Fabric 1.x which we do not control. Once modern Fabric gets up to 3.x,
4.x etc, we’ll likely continue distributing it via both fabric and fabric2 for convenience; there will never be any official fabric3,
fabric4 etc.
In other words, fabric2 is purely there to help users of 1.x cross the
2.0 “major rewrite” barrier; future major versions will not be large rewrites and will only have small sets of backward incompatibilities.
Source
Please be aware that you have two versions of Python installed on your system. python2.7 and python3.6. When you call pip install PACKAGE_NAME it invokes by default the pip associated with ptyhon2.7.
To make sure which one is used type the following command pip --version. I guess it will return something like this pip x.x.x from /usr/lib/python2.7/site-packages (python 2.7). Thus, you have to install pip for python3.6 on your system. Please notice that you have then to use pip3 instead of pip.
Uninstall fabri3 by executing the following command: pip uninstall fabric3
Install fabric2 using newly installed pip3 install fabric>=2.4.0
Run fab deploy from the directory where you have your deploy script. Don't forget to give the name deploy to your function which is responsible for the deploy like this:
from fabric import Connection as connection, task
#task
def deploy(ctx):
with connection(host=host, user=user) as c:
c.run('pwd')

Problem with installing GNU make in Python27

I got an error message saying that
ERROR: Could not find a version that satisfies the requirement make-3.82 (from versions: none)
ERROR: No matching distribution found for make-3.82
I'm using the Python27 environment and tried with GNU make-3.79 to all newer libraries up to GNU make-3.42 by downloading from ftp://ftp.gnu.org/gnu/make/, but the same problem repeating for all version.
$ pip install make-3.79
My final gall is to install library "elevation" with all dependencies of
GNU maker, curl, unzip, gunzip in python27.

Categories