Error when running pip install discord.py - discord

I am on a mac OS with python 3.5.3
I am completely new to python.
This is the command line when I try to run pip install discord.py
ERROR: Command errored out with exit status 1:
command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/7k/_5tkn2z940bfbjwc6jxhdvb40000gp/T/pip-install-HvXx9C/aiohttp/setup.py'"'"'; __file__='"'"'/private/var/folders/7k/_5tkn2z940bfbjwc6jxhdvb40000gp/T/pip-install-HvXx9C/aiohttp/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/7k/_5tkn2z940bfbjwc6jxhdvb40000gp/T/pip-pip-egg-info-Zb_d0r
cwd: /private/var/folders/7k/_5tkn2z940bfbjwc6jxhdvb40000gp/T/pip-install-HvXx9C/aiohttp/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/7k/_5tkn2z940bfbjwc6jxhdvb40000gp/T/pip-install-HvXx9C/aiohttp/setup.py", line 60, in <module>
raise RuntimeError("aiohttp requires Python 3.4.2+")
RuntimeError: aiohttp requires Python 3.4.2+
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

This is because your pip command is pointing to Python 2. discord.py requires Python 3.4.2 or higher. Try using:
pip3 install discord.py

Related

Microsoft SQL Server Installation error(PArrot OS)

I have been trying to install microsoft SQL server on my lInux machine but it keeps throwing the same error, even after following the instructions given here on this platform.
When I run:
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
It throws this error:
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 95, in <module>
sp = SoftwareProperties(options=options)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 103, in __init__
self.sourceslist = SourcesList()
File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 276, in __init__
self.refresh()
File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 292, in refresh
self.matcher.match(source)
File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 484, in match
if (re.search(template.match_uri, source.uri) and
File "/usr/lib/python3.9/re.py", line 201, in search
return _compile(pattern, flags).search(string)
File "/usr/lib/python3.9/re.py", line 304, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib/python3.9/sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
File "/usr/lib/python3.9/sre_parse.py", line 948, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "/usr/lib/python3.9/sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "/usr/lib/python3.9/sre_parse.py", line 834, in _parse
p = _parse_sub(source, state, sub_verbose, nested + 1)
File "/usr/lib/python3.9/sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "/usr/lib/python3.9/sre_parse.py", line 834, in _parse
p = _parse_sub(source, state, sub_verbose, nested + 1)
File "/usr/lib/python3.9/sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "/usr/lib/python3.9/sre_parse.py", line 668, in _parse
raise source.error("nothing to repeat",
re.error: nothing to repeat at position 2
and when I run:
sudo apt install mssql-server
It throws the following error:
The following packages have unmet dependencies:
mssql-server : Depends: libssl1.0.0 but it is not installable
E: Unable to correct problems, you have held broken packages.
I am unable to install libssl1.0.0 since its already in its latest version, libssl1.1
What do I do??
The output for cat /etc/debian_version is parrot
And output of cat /etc/os-release is
PRETTY_NAME="Parrot OS 5.0 (Electro Ara)"
NAME="Parrot OS"
VERSION_ID="5.0"
VERSION="5.0 (Electro Ara)"
VERSION_CODENAME=ara
ID=parrot
ID_LIKE=debian
HOME_URL="https://www.parrotsec.org/"
SUPPORT_URL="https://community.parrotsec.org/"
BUG_REPORT_URL="https://community.parrotsec.org/"
ParrotOS is a Linux distribution based on Debian with a focus on security, privacy and development. You might want to check your reasons for installing SQL Server on it, perhaps you might wish to use a different distro.
The following shows how you can install Microsoft SQL Server 2019 on a ParrotOS 5.0 (ara) Docker container...
./docker-compose.yml:
version: "3.8"
services:
parrot:
build: parrot
container_name: parrot
environment:
- "ACCEPT_EULA=Y"
- "SA_PASSWORD=StrongPassw0rd"
ports:
- "1433:1433"
./parrot/Dockerfile:
# REFs:
# 1. Parrot on Docker
# https://parrotsec.org/docs/parrot-on-docker.html
# 2. SQL Server on Linux
# https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-overview
# 3. Quickstart: Install SQL Server and create a database on Ubuntu
# https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu
FROM parrotsec/core:5.0.0
RUN apt-get update
RUN apt-get install --yes wget
RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list > /etc/apt/sources.list.d/mssql-server-2019.list
RUN apt-get update
RUN apt-get install --yes mssql-server
USER mssql
EXPOSE 1433
ENTRYPOINT [ "/opt/mssql/bin/sqlservr" ]
After running docker-compose up --build you can connect to the running container (in this case, from the Docker host computer) to execute SQL queries...
$ sqlcmd -S localhost,1433 -U sa -P StrongPassw0rd
1> SELECT GETDATE()
2> GO
-----------------------
2022-05-28 11:36:37.783
(1 rows affected)

Traceback (most recent call last): File "./odoo-bin", line 5, in <module>

Traceback (most recent call last):
File "./odoo-bin", line 5, in
import odoo
File "/opt/odoo/odoo/odoo/init.py", line 73, in
import babel
ModuleNotFoundError: No module named 'babel'
In Odoo should install first all requirements
Navigate to your project folder then try to run this command in terminal
pip install -r requirements.txt
If get any error while this command execution, resolve that errors then only Odoo server work.
If you use multi version of python
Check version:
python --version
e.g For me: Python 3.7.7
py -3.7 -m pip install -r requirements.txt

Syntax Error in google-api-python-client

While attempting to follow the Appengine quickstart the following error message appears:
httplib2/__init__.py", line 352
print('%s:' % h, end=' ', file=self._fp)
^
SyntaxError: invalid syntax
I had the same issue but my solution was to run pip in a virtual environment for the correct Python version, in my case it was 2.7.
virtualenv --python=python2.7 .venv27
source .venv27/bin/activate
pip2.7 install -r requirements.txt -t lib
When installing google-api-python-client, the following is recommended:
pip install -t lib google-api-python-client
If this command is used in an enviornment running python 3, the lib installed copy will fail.
Better to explicily state pip2:
pip2 install -t lib google-api-python-client

Cannot pip install SolrClient (python2.6 vs 3.4 issues?)

I am trying to pip install SolrClient, and I believe I am having some difficulty with my version of python.
Here is the error message.
[root#centos64 ~]# pip install SolrClient
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting SolrClient
Using cached SolrClient-0.1.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-UeQsqQ/SolrClient/setup.py", line 4, in <module>
import SolrClient
File "SolrClient/__init__.py", line 1, in <module>
from .solrclient import SolrClient
File "SolrClient/solrclient.py", line 10, in <module>
from .collections import Collections
File "SolrClient/collections.py", line 7, in <module>
from collections import defaultdict
ImportError: cannot import name defaultdict
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-UeQsqQ/SolrClient/
So, when I go to check my python version, it is 2.6
[root#centos64 ~]# python -V
Python 2.6.6
I've got python 3.4 on my machine, albeit I need to call it like this
[root#centos64 ~]# python3.4 -V
Python 3.4.3
So, a few questions.
Am I correct in my assumption that my error is due to the fact that I am attempting to pip install using python2.6?
If so, how do I either
a) tell pip to use the python3.4 version? (not sure if this is the right way of thinking about it)
b) adjust my system to use python3.4
Otherwise, I am not sure how to proceed here. Thoughts?
I did indeed need to use python3.4
As suggested, I went with a virtual environment for the task.
pip install pew
pew new -p `which python3.4` 3.4
pew workon 3.4
pip install SolrClient
sudo apt install virtualenv
virtualenv -p python3 <envname>
cd <envname>
source bin/activate
pip install SolrClient

Jenkins gcloud deployment causes ImportError

I've set up a Jenkins instance in Google Compute Engine to build and deploy an App Engine Java project following this page from Google.
I've configured Jenkins to run the following shell command only when the Maven build succeeds: gcloud --project=decent-ellipse-843 preview app deploy target/*-SNAPSHOT/
When I attempt a build, the deployment fails with the following trace:
+ gcloud --project=decent-ellipse-843 preview app deploy target/backend-api-0.0.1-SNAPSHOT/
Traceback (most recent call last):
File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 183, in <module>
main()
File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 179, in main
_cli.Execute()
File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 488, in Execute
post_run_hooks=self.__post_run_hooks)
File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1016, in Run
result = command_instance.Run(args)
File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/calliope/exceptions.py", line 86, in TryFunc
return func(*args, **kwargs)
File "/usr/local/share/google/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/deploy.py", line 158, in Run
stage_dir = self.__MakeStagingDir(project, args, deployable)
File "/usr/local/share/google/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/deploy.py", line 268, in __MakeStagingDir
java_app_update = appcfg_java.JavaAppUpdate(deployable, args)
File "/usr/local/share/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/appcfg_java.py", line 146, in __init__
self.app_engine_web_xml = self._ReadAppEngineWebXml()
File "/usr/local/share/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/appcfg_java.py", line 205, in _ReadAppEngineWebXml
parser=app_engine_web_xml_parser.AppEngineWebXmlParser)
File "/usr/local/share/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/appcfg_java.py", line 217, in _ReadAndParseXml
return parser().ProcessXml(file_handle.read())
File "/usr/local/share/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/app_engine_web_xml_parser.py", line 71, in ProcessXml
xml_root = ElementTree.fromstring(xml_str)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1300, in XML
parser = XMLParser(target=TreeBuilder())
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1466, in __init__
"No module named expat; use SimpleXMLTreeBuilder instead"
ImportError: No module named expat; use SimpleXMLTreeBuilder instead
Build step 'Execute shell' marked build as failure
Finished: FAILURE
The Maven build is successful, and I can deploy the project by issuing the gcloud command manually.
Even when I run the exact same gcloud command from the same directory and under the same user (tomcat), the deployment succeeds without errors.
I have re-installed python and updated the Google Cloud SDK without any results.
The instance is running Python 2.7.3, Jenkins 1.598, JDK 7u76 and Maven 3.2.2.
I hope someone can help me out with this!
I ran into a similar issue running my jobs on the cloud-dev-python slave. The images are missing build tools that you may need in order to build and deploy properly. My solution was to connect to the docker image and install the tools manually the first time around.
# on docker host, connect to java image
CONTAINER_ID=$(docker ps | grep cloud-dev-java | awk '{print $1}');
docker exec -i -t $CONTAINER_ID bash
# on docker image, install crap to build lxml, etc
gcloud -q components update preview app && apt-get update \
&& apt-get install -y build-essential libz-dev libxml2-dev \
libxslt1-dev python-dev python-pip && apt-get autoremove
Give that a whirl and see if it helps. I'm currently stuck with the service account not authenticating even though it is set up properly...

Resources