Can't install twython on Python 3.2 (Raspberry Pi) - python-3.x

I'm trying to install twython, but keep getting errors.
First attempt:
pi#raspberrypi ~/twython $ sudo pip-3.2 install twython
Running setup.py egg_info for package requests
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/pi/twython/build/requests/setup.py", line 52, in <module>
exec(f.read(), about)
File "<string>", line 14
__cake__ = u'\u2728 \U0001f370 \u2728'
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/pi/twython/build/requests/setup.py", line 52, in <module>
exec(f.read(), about)
File "<string>", line 14
__cake__ = u'\u2728 \U0001f370 \u2728'
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/pi/twython/build/requests
Next I searched on the last line of the error and followed some suggestions that said to make sure setuptools and ez_install were installed and up to date, but that didn't help.
Then I followed the backup instructions on ReadtheDocs that said to try to install it this way:
git clone git://github.com/ryanmcgrath/twython.git
cd twython
sudo python3 setup.py install
but it failed again:
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 640, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 692, in process_distribution
[requirement], self.local_index, self.easy_install
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 576, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 822, in best_match
return self.obtain(req, installer) # try and download/install
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 834, in obtain
return installer(requirement)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 608, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 638, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 828, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1105, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1094, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 31, in run_setup
lambda: exec(compile(open(
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 73, in run
return func()
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 34, in <lambda>
{'__file__':setup_script, '__name__':'__main__'})
File "setup.py", line 52, in <module>
Error in atexit._run_exitfuncs:
TypeError: 'NoneType' object is not callable

It turns out that Twython cannot work with Python v3.2 because it depends on the requests module which apparently is not supported in Python 3.2.
One of the developers of Twython just explained this to me on Twitter.

Related

poetry install fails with [CalledProcessError] while installing github submodule

I'm new to python and github. when I'm trying to install few submodules getting below error.
I'm using git bash on windows
pip is at latest version 20.2.3.
able to install other submodules using poetry successfully
$ poetry install -vvv
Using virtualenv: E:\Dev\venv\venv_test
Installing dependencies from lock file
[CalledProcessError]
Command '['C:\\Users\\88810\\AppData\\Local\\Temp\\tziwqwewd56\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 3221226505.
Traceback (most recent call last):
File "C:\Users\88810\.poetry\lib\poetry\_vendor\py3.6\clikit\console_application.py", line 131, in run
status_code = command.handle(parsed_args, io)
File "C:\Users\88810\.poetry\lib\poetry\_vendor\py3.6\clikit\api\command\command.py", line 120, in handle
status_code = self._do_handle(args, io)
File "C:\Users\88810\.poetry\lib\poetry\_vendor\py3.6\clikit\api\command\command.py", line 171, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "C:\Users\88810\.poetry\lib\poetry\_vendor\py3.6\cleo\commands\command.py", line 92, in wrap_handle
return self.handle()
File "C:\Users\88810\.poetry\lib\poetry\console\commands\install.py", line 69, in handle
return_code = installer.run()
File "C:\Users\88810\.poetry\lib\poetry\installation\installer.py", line 74, in run
self._do_install(local_repo)
File "C:\Users\88810\.poetry\lib\poetry\installation\installer.py", line 225, in _do_install
ops = solver.solve(use_latest=whitelist)
File "C:\Users\88810\.poetry\lib\poetry\puzzle\solver.py", line 36, in solve
packages, depths = self._solve(use_latest=use_latest)
File "C:\Users\88810\.poetry\lib\poetry\puzzle\solver.py", line 181, in _solve
self._package, self._provider, locked=locked, use_latest=use_latest
File "C:\Users\88810\.poetry\lib\poetry\mixology\__init__.py", line 7, in resolve_version
return solver.solve()
File "C:\Users\88810\.poetry\lib\poetry\mixology\version_solver.py", line 80, in solve
next = self._choose_package_version()
File "C:\Users\88810\.poetry\lib\poetry\mixology\version_solver.py", line 388, in _choose_package_version
version = self._provider.complete_package(version)
File "C:\Users\88810\.poetry\lib\poetry\puzzle\provider.py", line 601, in complete_package
self.search_for_vcs(r)
File "C:\Users\88810\.poetry\lib\poetry\puzzle\provider.py", line 175, in search_for_vcs
name=dependency.name,
File "C:\Users\88810\.poetry\lib\poetry\puzzle\provider.py", line 213, in get_package_from_vcs
package = cls.get_package_from_directory(tmp_dir, name=name)
File "C:\Users\88810\.poetry\lib\poetry\puzzle\provider.py", line 361, in get_package_from_directory
cls._execute_setup()
File "C:\Users\88810\.poetry\lib\poetry\puzzle\provider.py", line 872, in _execute_setup
EnvManager.build_venv(tmp_dir)
File "C:\Users\88810\.poetry\lib\poetry\utils\env.py", line 688, in build_venv
builder.create(str(path))
File "E:\python36\lib\venv\__init__.py", line 67, in create
self._setup_pip(context)
File "E:\python36\lib\venv\__init__.py", line 245, in _setup_pip
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
File "E:\python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "C:\Users\88810\.poetry\lib\poetry\utils\_compat.py", line 206, in run
retcode, process.args, output=stdout, stderr=stderr
(venv_test)
I was able to resolve the issue after following these steps:
Upgraded python 3.6 to 3.7.4.
I had earlier installed python on E drive, installed it on C drive.

How to solve the errors when using pip install Pillow

"pip install Pillow" got error!
I installed Debian system on Orange Pie zero
(http://www.orangepi.org/download resources/orangepizero/2016-11-24/orangepizero_3cf6c296784e7ae2cd8cb.html)
Linux OrangePizero 3.4.39 #2 SMP PREEMPT Mon Nov 21 16:23:11 CST 2016 armv7l
GNU/Linux
Python 3.4.2
pip 1.5.6 from /usr/lib/python3/dist-packages (python 3.4)
When I installed pillow with pip3, I encountered the following error
Downloading/unpacking Pillow
Downloading Pillow-6.1.0.tar.gz (33.8MB): 33.8MB downloaded
Running setup.py (path:/tmp/pip-build-g2pkqhvw/Pillow/setup.py) egg_info for package Pillow
/usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-g2pkqhvw/Pillow/setup.py", line 873, in <module>
zip_safe=not (debug_build() or PLATFORM_MINGW),
File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "<string>", line 15, in replacement_run
File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 193, in find_sources
mm.run()
File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 277, in run
self.add_defaults()
File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 306, in add_defaults
sdist.add_defaults(self)
File "/usr/lib/python3/dist-packages/setuptools/command/sdist.py", line 183, in add_defaults
build_ext = self.get_finalized_command('build_ext')
File "/usr/lib/python3.4/distutils/cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/lib/python3.4/distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/tmp/pip-build-g2pkqhvw/Pillow/setup.py", line 324, in finalize_options
if sys.version_info.major >= 3 and not self.parallel:
File "/usr/lib/python3.4/distutils/cmd.py", line 103, in __getattr__
raise AttributeError(attr)
AttributeError: parallel
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/Pillow.egg-info
writing dependency_links to pip-egg-info/Pillow.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/Pillow.egg-info/top_level.txt
writing pip-egg-info/Pillow.egg-info/PKG-INFO
writing manifest file 'pip-egg-info/Pillow.egg-info/SOURCES.txt'
/usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
warning: manifest_maker: standard file '-c' not found
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-g2pkqhvw/Pillow/setup.py", line 873, in <module>
zip_safe=not (debug_build() or PLATFORM_MINGW),
File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "<string>", line 15, in replacement_run
File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 193, in find_sources
mm.run()
File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 277, in run
self.add_defaults()
File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 306, in add_defaults
sdist.add_defaults(self)
File "/usr/lib/python3/dist-packages/setuptools/command/sdist.py", line 183, in add_defaults
build_ext = self.get_finalized_command('build_ext')
File "/usr/lib/python3.4/distutils/cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/lib/python3.4/distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/tmp/pip-build-g2pkqhvw/Pillow/setup.py", line 324, in finalize_options
if sys.version_info.major >= 3 and not self.parallel:
File "/usr/lib/python3.4/distutils/cmd.py", line 103, in __getattr__
raise AttributeError(attr)
AttributeError: parallel
I hope to solve this problem.
Thank you in advance for your help.
Use Python 3.5+ or older version of Pillow. Python 3.4 is retired:
https://github.com/python-pillow/Pillow/issues/3581

Error while installing pip

While installing pip via get-pip.py faced this error, Any help on this will be appreciated.
C:\Python32>python get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 20061, in <module>
main()
File "get-pip.py", line 194, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
import pip
File "c:\users\kanika~1\appdata\local\temp\tmps55rv7\pip.zip\pip\__init__.py",
line 21, in <module>
File "c:\users\kanika~1\appdata\local\temp\tmps55rv7\pip.zip\pip\_vendor\requests\__init__.py", line 66, in <module>
File "c:\users\kanika~1\appdata\local\temp\tmps55rv7\pip.zip\pip\_vendor\requests\models.py", line 856
http_error_msg = u'%s Client Error: %s for url: %s' % (self.status_code, reason, self.url)
^
SyntaxError: invalid syntax

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-fkyx6m64/misaka/

I am using django 1.11 on fedora25. I am using virtual environment and while trying to install misaka:
pip install misaka
I got the following error:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-fkyx6m64/misaka/
Here is the traceback:
Collecting django-misaka
Downloading django-misaka-0.2.1.tar.gz
Collecting houdini.py (from django-misaka)
Downloading houdini.py-0.1.0.tar.gz
Collecting misaka (from django-misaka)
Downloading misaka-2.1.0.tar.gz (127kB)
100% |████████████████████████████████| 133kB 317kB/s
Complete output from command python setup.py egg_info:
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
No working compiler found, or bogus compiler options
passed to the compiler from Python's distutils module.
See the error messages above.
(If they are about -mno-fused-madd and you are on OS/X 10.8,
see http://stackoverflow.com/questions/22313407/ .)
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 156, in save_modules
yield saved
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 197, in setup_context
yield
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 246, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 276, in run
return func()
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 245, in runner
_execfile(setup_script, ns)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 47, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 135, in <module>
File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 70, in ask_supports_thread
'Topic :: Text Processing :: Markup',
File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 52, in no_working_compiler_found
packages=['misaka'],
SystemExit: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1099, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 249, in run_setup
raise
File "/usr/lib64/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 197, in setup_context
yield
File "/usr/lib64/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 168, in save_modules
saved_exc.resume()
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 143, in resume
six.reraise(type, exc, self._tb)
File "/usr/lib/python3.5/site-packages/pkg_resources/_vendor/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 156, in save_modules
yield saved
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 197, in setup_context
yield
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 246, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 276, in run
return func()
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 245, in runner
_execfile(setup_script, ns)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 47, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 135, in <module>
File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 70, in ask_supports_thread
'Topic :: Text Processing :: Markup',
File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 52, in no_working_compiler_found
packages=['misaka'],
SystemExit: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-fkyx6m64/misaka/setup.py", line 76, in <module>
cffi_modules=['build_ffi.py:ffi'],
File "/usr/lib64/python3.5/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3.5/site-packages/setuptools/dist.py", line 348, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python3.5/site-packages/setuptools/dist.py", line 394, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 826, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1098, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1110, in obtain
return installer(requirement)
File "/usr/lib/python3.5/site-packages/setuptools/dist.py", line 461, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 663, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 693, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 874, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1113, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1101, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-fkyx6m64/misaka/
I got a similar issue while using virtual environment. Explicitly mention pip2, this might work
pip2 install misaka
and while executing also mention python2
python2 example.py
I am solved it by take this way:
install conda with prombt of conda install : conda install libpython m2w64-toolchain -c msys2
upgrade your pip by : python -m pip install --upgrade pip
instal misaka : pip install misaka

pylint not running on MacOS

It seems that pylint on MacOS is not doing anything at all. Here is what I get. I did install pylint by doing pip install pylint
$ pylint tunnel.py
No config file found, using default configuration
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pylint/lint.py", line 910, in get_ast
return MANAGER.ast_from_file(filepath, modname, source=True)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/manager.py", line 112, in ast_from_file
return AstroidBuilder(self).file_build(filepath, modname)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/builder.py", line 134, in file_build
module = self._data_build(data, modname, path)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/builder.py", line 177, in _data_build
module = rebuilder.visit_module(node, modname, node_file, package)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/rebuilder.py", line 148, in visit_module
newnode.body = [self.visit(child, newnode) for child in node.body]
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/rebuilder.py", line 148, in <listcomp>
newnode.body = [self.visit(child, newnode) for child in node.body]
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/rebuilder.py", line 161, in visit
return self._transform(visit_method(node, parent))
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/rebuilder.py", line 238, in visit_assign
newnode.value = self.visit(node.value, newnode)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/rebuilder.py", line 161, in visit
return self._transform(visit_method(node, parent))
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/rebuilder.py", line 331, in visit_callfunc
if node.starargs is not None:
AttributeError: 'Call' object has no attribute 'starargs'
************* Module temp.test
F: 1, 0: <class 'AttributeError'>: 'Call' object has no attribute 'starargs' (astroid-error)
You're mentioning that you're using pylint 1.4.4, which is quite old and won't work with Python 3.5.
You should upgrade to the latest releases of pylint/astroid, e.g. by doing pip install -U pylint.

Resources