What's the latest sphinx version which supports Python 2.7? - python-sphinx

I am having trouble packaging Sphinx v4.2 on Python v2.7.18:
========== 1733 passed, 3 skipped, 3477 warnings in 663.79s (0:11:03) ==========
==> Entering fakeroot environment...
==> Starting package()...
Traceback (most recent call last):
File "setup.py", line 8, in <module>
import sphinx
File "/home/user/Projects/aur/python2-sphinx/src/Sphinx-4.2.0/sphinx/__init__.py", line 20, in <module>
from .deprecation import RemovedInNextVersionWarning
File "/home/user/Projects/aur/python2-sphinx/src/Sphinx-4.2.0/sphinx/deprecation.py", line 28
def deprecated_alias(modname: str, objects: Dict[str, object],
^
SyntaxError: invalid syntax
Since the above error regards Python 3.x typehinting and installing python2-typing didn't make a difference, I am guessing python 2 support must have been deprecated, so
what's the latest sphinx version supporting Python 2.x?

Latest PKGBUILD for python2-sphinx was for version 1.8.5.

Related

Problem installing importlib on Mac with pip3

Good morning!
Until yesterday I was using python 2.7 and using the following code for writing output files for my scripts:
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
But now I'm upgrading my code to python 3.7, so now I need to use importlib.reloadinstead of just reload. However, typing sudo -H pip3 install importlib on my shell gives me the following error:
Collecting importlib
Using cached https://files.pythonhosted.org/packages/31/77/3781f65cafe55480b56914def99022a5d2965a4bb269655c89ef2f1de3cd/importlib-1.0.4.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 6, in <module>
import distutils.core
File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 16, in <module>
from distutils.dist import Distribution
File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 19, in <module>
from distutils.util import check_environ, strtobool, rfc822_escape
File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/util.py", line 9, in <module>
import importlib.util
ModuleNotFoundError: No module named 'importlib.util'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-install-3cz_3d6n/importlib/
After looking for solutions I also tried to upgrade setuptools, but that didn't fix my problem.
Many thanks in advance!
importlib at PyPI is an outdated package intended for very old Python versions. For new versions of Python importlib is a module from the standard library, you don't need to install it, it's always available.

catch_config_error while trying to run ipython3

I'm getting the following error trying to run ipython3.
catch_config_error() missing 1 required positional argument: 'app'
I first got it on my Mac (python36). As my system has all sorts of customizations, I tried it again on a Linux system (Centos 7.4). I install ipython using pip3 and everything seemed to install cleanly. (On the same system, if i do this with python2, it seems to work.
Complete error log:
[scott] ipython3
Traceback (most recent call last):
File "/usr/bin/ipython3", line 7, in <module>
from IPython import start_ipython
File "/usr/lib/python3.4/site-packages/IPython/__init__.py", line 54, in <module>
from .core.application import Application
File "/usr/lib/python3.4/site-packages/IPython/core/application.py", line 23, in <module>
from traitlets.config.application import Application, catch_config_error
File "/usr/lib/python3.4/site-packages/traitlets/config/__init__.py", line 6, in <module>
from .application import *
File "/usr/lib/python3.4/site-packages/traitlets/config/application.py", line 120, in <module>
class Application(SingletonConfigurable):
File "/usr/lib/python3.4/site-packages/traitlets/config/application.py", line 291, in Application
def initialize(self, argv=None):
TypeError: catch_config_error() missing 1 required positional argument: 'app'
This is happening because traitlets relies on a package called 'decorator' that was just updated from 4.1.2 to 4.2.0 and broken its backward compatibility.
If you're using a requirements file or pip, install decorator==4.1.2 before installing IPython.
I tried in Ubuntu 16.04.
I also had the same problem (Python 3.6)
I tried again today.
$ sudo -H pip3 install --upgrade ipython
Then, decorator 4.2.1 is newly installed and the problem is solved.

Error raised while trying to install PyV8 for Python 3.4

I tried to install PyV8 for Python 3.4, but an error was raised. I googled for solutions, but I couldn't find a way to install PyV8 for Python 3.4 on Windows.
My system:
Windows 10 home
Python 3.4 (64bit)
Eclipse Neon 2
I tried using PIP:
C:\Program Files (x86)\Python34\Scripts>pip install pyv8
Downloading/unpacking pyv8
Downloading PyV8-0.5.zip
Running setup.py (path:C:\Users\ME\AppData\Local\Temp\pip_build_Sebastian Weidemann\pyv8\setup.py) egg_info for package pyv8
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "C:\Users\ME\AppData\Local\Temp\pip_build_Sebastian Weidemann\pyv8\setup.py", line 17, in <module>
include_dirs += os.environ["INCLUDE"].split(';')
File "C:\Program Files (x86)\Python34\lib\os.py", line 651, in __getitem__
raise KeyError(key) from None
KeyError: 'INCLUDE'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "C:\Users\ME\AppData\Local\Temp\pip_build_Sebastian Weidemann\pyv8\setup.py", line 17, in <module>
include_dirs += os.environ["INCLUDE"].split(';')
File "C:\Program Files (x86)\Python34\lib\os.py", line 651, in __getitem__
raise KeyError(key) from None
KeyError: 'INCLUDE'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in C:\Users\ME\AppData\Local\Temp\pip_build_ME\pyv8
Storing debug log for failure in C:\Users\ME\pip\pip.log
C:\Program Files (x86)\Python34\Scripts>
Apparently it's a problem of compatibility. If you look at https://pypi.python.org/pypi/PyV8 you will see the download list https://code.google.com/archive/p/pyv8/downloads which are compatible only with Python 2.5, 2.6 and 2.7. So it seems that you can't use PyV8 together with Python 3. At least I couldn't after trying for several hours.

python selenium windows chrome webdriver giving error

I am getting the following errors while trying all the solutions I could find on my own with no success like copying the whole selenium folder to main python folder, changing the path, using the absolute path etc, I would really appreciate the help as a newbie who just got started with python and selenium.
C:\Users\WorkStation\Desktop\chromedriver.exe
Error : -
C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\python.exe
C:/Users/WorkStation/PycharmProjects/test/scraptest/scrap.py File
"C:/Users/WorkStation/PycharmProjects/test/scraptest/scrap.py", line 3
driver = webdriver.Chrome("C:\Users\WorkStation\Desktop\chromedriver.exe")
^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated
\UXXXXXXXX escape
Process finished with exit code 1
Then I tried this and now more errors:
driver = webdriver.Chrome("C:\\Users\\WorkStation\\Desktop\\chromedriver.exe")
Error : -
C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\python.exe
C:/Users/WorkStation/PycharmProjects/test/scraptest/scrap.py Traceback
(most recent call last): File
"C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py",
line 74, in start
stdout=self.log_file, stderr=self.log_file) File "C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py",
line 665, in init
errread, errwrite) = self._get_handles(stdin, stdout, stderr) File
"C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py",
line 910, in _get_handles
c2pwrite = msvcrt.get_osfhandle(self._get_devnull()) File "C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py",
line 770, in _get_devnull
self._devnull = os.open(os.devnull, os.O_RDWR) FileNotFoundError: [Errno 2] No such file or directory: 'nul'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:/Users/WorkStation/PycharmProjects/test/scraptest/scrap.py", line
3, in
driver = webdriver.Chrome("C:\Users\WorkStation\Desktop\chromedriver.exe")
File
"C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py",
line 62, in init
self.service.start() File "C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py",
line 81, in start
os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message:
'chromedriver.exe' executable needs to be in PATH.
Exception ignored in: >
Traceback (most recent call last): File
"C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py",
line 173, in del
self.stop() File "C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py",
line 145, in stop
if self.process is None: AttributeError: 'Service' object has no attribute 'process'
Process finished with exit code 1
Even after copying the selenium files from the site-packages folder to the main python folder and adding the absolute path is not working
After doing the above step here is the error
C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\python.exe
C:/Users/WorkStation/PycharmProjects/test/scraptest/scrap.py Traceback
(most recent call last): File
"C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\selenium\webdriver\common\service.py",
line 74, in start
stdout=self.log_file, stderr=self.log_file) File "C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py",
line 665, in init
errread, errwrite) = self._get_handles(stdin, stdout, stderr) File
"C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py",
line 910, in _get_handles
c2pwrite = msvcrt.get_osfhandle(self._get_devnull()) File "C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py",
line 770, in _get_devnull
self._devnull = os.open(os.devnull, os.O_RDWR) FileNotFoundError: [Errno 2] No such file or directory: 'nul'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:/Users/WorkStation/PycharmProjects/test/scraptest/scrap.py", line
3, in
driver = webdriver.Chrome("C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\selenium\webdriver\chrome\chromedriver.exe")
File
"C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\selenium\webdriver\chrome\webdriver.py",
line 62, in init
self.service.start() File "C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\selenium\webdriver\common\service.py",
line 81, in start
os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message:
'chromedriver.exe' executable needs to be in PATH.
Exception ignored in: >
Traceback (most recent call last): File
"C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\selenium\webdriver\common\service.py",
line 173, in del
self.stop() File "C:\Users\WorkStation\AppData\Local\Programs\Python\Python36-32\selenium\webdriver\common\service.py",
line 145, in stop
if self.process is None: AttributeError: 'Service' object has no attribute 'process'
Process finished with exit code 1
Here is the screenshot of the issue in PyCharm
System Config:
windows 32-bit
PyDispatcher 2.0.5 2.0.5
attrs 16.3.0 16.3.0
beautifulsoup4 4.5.3 4.5.3
cffi 1.9.1 1.9.1
constantly 15.1.0 15.1.0
cryptography 1.7.1 1.7.1
cssselect 1.0.0 1.0.0
idna 2.2 2.2
incremental 16.10.1 16.10.1
mechanize 0.2.5 0.2.5
pip 9.0.1 9.0.1
pyOpenSSL 16.2.0 16.2.0
pyasn1 0.1.9 0.1.9
pyasn1-modules 0.0.8 0.0.8
pycparser 2.17 2.17
requests 2.12.4 2.12.4
selenium 3.0.2 3.0.2
service-identity 16.0.0
setuptools 32.3.1 32.3.1
six 1.10.0 1.10.0
urllib3 1.19.1 1.19.1
wheel 0.29.0 0.30.0a0
zope.interface 4.3.3 4.3.3
Chrome webdriver Latest Version 2.27
Chrome browser Version Version 55.0.2883.87 m (Up to date)
This SO Q&A might answer your question
I had this problem and I changed the backslash (\\) to forward slash (/).
try this:
driver = webdriver.Chrome('C:/Users/WorkStation/Desktop/chromedriver.exe')

Wand does not work under python 64 bit and imagemagick 64 bit: cannot find shared libraries

I am running python 2.7 64bit on windows and have installed imagemagick 64 bit (latest version available) with the necessary headers and env variables as stated in the guide. Unfortunately I am able to install wand via pip but as soon as I try to use wand I get this error:
>>> from wand.image import Image
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\wand\image.py", line 20, in <module>
from .api import MagickPixelPacket, libc, libmagick, library
File "C:\Python27\lib\site-packages\wand\api.py", line 205, in <module>
'Try to install:\n ' + msg)
ImportError: MagickWand shared library not found.
You probably had not installed ImageMagick library.
Try to install:
http://docs.wand-py.org/en/latest/guide/install.html#install-imagemagick-on-wi
ndows
Has anyone experienced this issue? Thanks in advance.
Install the version: ImageMagick-6.9.8-9-Q16-x64-dll.exe
Wand doesn't support the latest version as of yet.

Resources