On Fedora 27 when I run cookiecutter https://github.com/pydanny/cookiecutter-django I get:
File "/usr/bin/cookiecutter", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3038, in <module>
#_call_aside
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3022, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3051, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 657, in _build_master
ws.require(__requires__)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 971, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 857, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'future>=0.15.2' distribution was not found and is required by cookiecutter
This is a known issue:
python-cookiecutter-1.6.0-3.fc27 has been pushed to the Fedora 27 testing repository.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
Related
I try to run pytest with allure on my docker image, but it reports an "invalid syntax" error. Is there any python version requirement for allure? The python version on my docker image is 2.7.13.
Can anyone help me?
root#ubuntu:/fuego-rw/buildzone# pytest allure_title.py
Traceback (most recent call last):
File "/usr/local/bin/pytest", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/_pytest/config/__init__.py", line 65, in main
config = _prepareconfig(args, plugins)
File "/usr/local/lib/python2.7/dist-packages/_pytest/config/__init__.py", line 214, in _prepareconfig
pluginmanager=pluginmanager, args=args
File "/usr/local/lib/python2.7/dist-packages/pluggy/hooks.py", line 286, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/usr/local/lib/python2.7/dist-packages/pluggy/manager.py", line 93, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/usr/local/lib/python2.7/dist-packages/pluggy/manager.py", line 87, in <lambda>
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "/usr/local/lib/python2.7/dist-packages/pluggy/callers.py", line 203, in _multicall
gen.send(outcome)
File "/usr/local/lib/python2.7/dist-packages/_pytest/helpconfig.py", line 94, in pytest_cmdline_parse
config = outcome.get_result()
File "/usr/local/lib/python2.7/dist-packages/pluggy/callers.py", line 81, in get_result
_reraise(*ex) # noqa
File "/usr/local/lib/python2.7/dist-packages/pluggy/callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "/usr/local/lib/python2.7/dist-packages/_pytest/config/__init__.py", line 789, in pytest_cmdline_parse
self.parse(args)
File "/usr/local/lib/python2.7/dist-packages/_pytest/config/__init__.py", line 997, in parse
self._preparse(args, addopts=addopts)
File "/usr/local/lib/python2.7/dist-packages/_pytest/config/__init__.py", line 943, in _preparse
self.pluginmanager.load_setuptools_entrypoints("pytest11")
File "/usr/local/lib/python2.7/dist-packages/pluggy/manager.py", line 299, in load_setuptools_entrypoints
plugin = ep.load()
File "/usr/local/lib/python2.7/dist-packages/importlib_metadata/__init__.py", line 105, in load
module = import_module(match.group('module'))
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/_pytest/assertion/rewrite.py", line 304, in load_module
exec(co, mod.__dict__)
File "/usr/local/lib/python2.7/dist-packages/allure_pytest/plugin.py", line 3, in <module>
import allure
File "/usr/local/lib/python2.7/dist-packages/allure.py", line 1, in <module>
from allure_commons._allure import title
File "/usr/local/lib/python2.7/dist-packages/allure_commons/__init__.py", line 3, in <module>
from allure_commons._allure import fixture # noqa: F401
File "/usr/local/lib/python2.7/dist-packages/allure_commons/_allure.py", line 165
def __call__(self, func: _TFunc) -> _TFunc:
^
SyntaxError: invalid syntax
This syntax:
func: _TFunc
is called a type hint, meaning the variable func is expected to be of type _TFunc (in simpler terms, num: int means the variable num is expected to be int).
The type hint feature was only made available from Python3.0 (PEP 3107) and Python3.5 (PEP 484), thus isn't available in the version you are using which is Python2.7.
def func(num: int):
print(num)
func(1)
Using Python2
File "Main.py", line 1
def func(num: int):
^
SyntaxError: invalid syntax
Using Python3
1
Either upgrade your Python version to >=3.5 or use an older version of allure-pytest. I would advise to upgrade Python as that would be more sustainable.
I have installed thrid party tool pip install ecs-deploy from https://github.com/fabfuel/ecs-deploy When I try to deploy ecs deploy demo-cluster demo-service I am getting some error
[ec2-user#ip-172-32-82-233 ~]$ ecs deploy demo-cluster demo-service
Traceback (most recent call last):
File "/usr/local/bin/ecs", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3049, in <module>
#_call_aside
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3033, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3062, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 660, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 673, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 863, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (botocore 1.12.92 (/usr/lib/python2.7/dist-packages), Requirement.parse('botocore<1.15.0,>=1.14.9'), set(['boto3']))
I just uninstalled aws-cli and installed again by taking reference of this https://docs.aws.amazon.com/cli/latest/userguide/install-linux.html. It worked
I installed pytest-bdd at /home/marlu/.local using python setup.py install --user, since I don't have admin privileges. Both python2.7 and pytest are located at /usr/bin/. When I check if pytest-bdd is working correctly by running py.test --version I get an error, could anyone tell me why? Thanks!
Error output:
Traceback (most recent call last):
File "/usr/bin/py.test", line 9, in <module>
load_entry_point('pytest==2.7.0', 'console_scripts', 'py.test-2.7')()
File "/usr/lib/python2.7/site-packages/_pytest/config.py", line 32, in main
config = _prepareconfig(args, plugins)
File "/usr/lib/python2.7/site-packages/_pytest/config.py", line 85, in _prepareconfig
pluginmanager=pluginmanager, args=args)
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 521, in __call__
return self._docall(self.methods, kwargs)
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 528, in _docall
firstresult=self.firstresult).execute()
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 393, in execute
return wrapped_call(method(*args), self.execute)
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 109, in wrapped_call
wrap_controller.send(call_outcome)
File "/usr/lib/python2.7/site-packages/_pytest/helpconfig.py", line 28, in pytest_cmdline_parse
config = outcome.get_result()
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 138, in get_result
py.builtin._reraise(*ex)
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 123, in __init__
self.result = func()
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 394, in execute
res = method(*args)
File "/usr/lib/python2.7/site-packages/_pytest/config.py", line 636, in pytest_cmdline_parse
self.parse(args)
File "/usr/lib/python2.7/site-packages/_pytest/config.py", line 746, in parse
self._preparse(args)
File "/usr/lib/python2.7/site-packages/_pytest/config.py", line 713, in _preparse
self.pluginmanager.consider_setuptools_entrypoints()
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 282, in consider_setuptools_entrypoints
self.register(plugin, name=name)
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 189, in register
reg(plugin, name) # may call addhooks
File "/usr/lib/python2.7/site-packages/_pytest/config.py", line 604, in _register_plugin
{'pluginmanager': self.pluginmanager})
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 360, in call_plugin
kwargs=kwargs, firstresult=True).execute()
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 394, in execute
res = method(*args)
File "/home/marlu/.local/lib/python2.7/site-packages/pytest_bdd-2.17.0-py2.7.egg/pytest_bdd/plugin.py", line 15, in pytest_addhooks
from pytest_bdd import hooks
File "/home/marlu/.local/lib/python2.7/site-packages/pytest_bdd-2.17.0-py2.7.egg/pytest_bdd/hooks.py", line 38, in <module>
#pytest.hookspec(firstresult=True)
AttributeError: 'module' object has no attribute 'hookspec'
#pytest.hookspec was introduced in pytest 2.8, so you'd need to upgrade pytest, or downgrade pytest-bdd to 2.16.1. (Whoops, I was the one who broke 2.7 compatibility)
I have managed to royally screw myself over by doing something which seemed innocuous.
i was getting the following error from my python script (brand['feed'] = the URL i'm making the request to):
**C:\Python27\lib\site-packages\requests\packages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Traceback (most recent call last):
File "D:\Phocas\Phocas-Automation\analytics\download_feed_cats.py", line 18, in <module>
data = requests.get(brand['feed'])
File "C:\Python27\lib\site-packages\requests\api.py", line 69, in get
return request('get', url, params=params, **kwargs)
File "C:\Python27\lib\site-packages\requests\api.py", line 50, in request
response = session.request(method=method, url=url, **kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 594, in send
history = [resp for resp in gen] if allow_redirects else []
File "C:\Python27\lib\site-packages\requests\sessions.py", line 196, in resolve_redirects
**adapter_kwargs
File "C:\Python27\lib\site-packages\requests\sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "C:\Python27\lib\site-packages\requests\adapters.py", line 431, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed**
So i asked the internet and the internet said do this:
pip install --upgrade ndg-httpsclient
So i did that and now i keep getting a RuntimeError when i run the same script, what's crazy is even if i just try and run pip in the shell, i get the same error!!
Phocas_Tommy#p3303386 MINGW64 /c/Python27
$ pip
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\pip.exe\__main__.py", line 5, in <module>
File "C:\Python27\lib\site-packages\pip\__init__.py", line 11, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "C:\Python27\lib\site-packages\pip\vcs\mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "C:\Python27\lib\site-packages\pip\download.py", line 22, in <module>
from pip._vendor import requests, six
File "C:\Python27\lib\site-packages\pip\_vendor\requests\__init__.py", line 53, in <module>
from .packages.urllib3.contrib import pyopenssl
File "C:\Python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\contrib\pyopenssl.py", line 43, in <module>
import OpenSSL.SSL
File "C:\Python27\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "C:\Python27\lib\site-packages\OpenSSL\rand.py", line 12, in <module>
from OpenSSL._util import (
File "C:\Python27\lib\site-packages\OpenSSL\_util.py", line 9, in <module>
binding = Binding()
File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 114, in __init__
self._ensure_ffi_initialized()
File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 126, in _ensure_ffi_initialized
cls._modules,
File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\utils.py", line 31, in load_library_for_binding
lib = ffi.verifier.load_library()
File "C:\Python27\lib\site-packages\cffi\verifier.py", line 96, in load_library
self._compile_module()
File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\utils.py", line 127, in _compile_module
"Attempted implicit compile of a cffi module. All cffi modules should "
RuntimeError: Attempted implicit compile of a cffi module. All cffi modules should be pre-compiled at installation time.
I have searched this error and can't seem to find anything which helps. I'm using python 2.7.6 on Windows Server 2008 R2 Standard 64-bit
Re-installing Python fixed this problem
I encounter, at all times, when i try to bind, scss and widgy, the same error.
With any django version, since 1.6.8 to 1.7.3,the last release, and django_pyscss any version, and finally django-widgy to 0.3.3 or other, always the same issue.
There my stack trace on PyDev :
Traceback (most recent call last):
File "C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\projects\workspace\MezzaTest2\manage.py", line 32, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\olive\Environnements\lib\site-packages\django\core\management\__init__.py", line 385, in execute_from_command_line
utility.execute()
File "C:\Users\olive\Environnements\lib\site-packages\django\core\management\__init__.py", line 354, in execute
django.setup()
File "C:\Users\olive\Environnements\lib\site-packages\django\__init__.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\olive\Environnements\lib\site-packages\django\apps\registry.py", line 108, in populate
app_config.import_models(all_models)
File "C:\Users\olive\Environnements\lib\site-packages\django\apps\config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "C:\Python27\Lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "C:\Users\olive\Environnements\lib\site-packages\widgy\contrib\page_builder\models.py", line 16, in <module>
from widgy.contrib.page_builder.db.fields import MarkdownField, VideoField, ImageField
File "C:\Users\olive\Environnements\lib\site-packages\widgy\contrib\page_builder\db\fields.py", line 13, in <module>
from widgy.contrib.page_builder.forms import MarkdownField as MarkdownFormField, MarkdownWidget
File "C:\Users\olive\Environnements\lib\site-packages\widgy\contrib\page_builder\forms\__init__.py", line 42, in <module>
class CKEditorWidget(forms.Textarea):
File "C:\Users\olive\Environnements\lib\site-packages\widgy\contrib\page_builder\forms\__init__.py", line 80, in CKEditorWidget
'contentsCss': scss_compile('/widgy/page_builder/html.scss'),
File "C:\Users\olive\Environnements\lib\site-packages\widgy\contrib\page_builder\forms\__init__.py", line 22, in scss_compile
css_content = scss.compile(scss_file=scss_filename)
File "C:\Users\olive\Environnements\lib\site-packages\pyscss-1.3.0.a1-py2.7.egg\scss\legacy.py", line 163, in compile
is_sass=is_sass,
File "C:\Users\olive\Environnements\lib\site-packages\pyscss-1.3.0.a1-py2.7.egg\scss\source.py", line 100, in from_filename
with open(fn, 'rb') as f:
IOError: [Errno 2] No such file or directory: '/widgy/page_builder/html.scss'
It seems that you are running the 1.3.0a1 version of PyScss. Widgy depends on django-pyscss, which currently only supports the 1.2.1 version of PyScss currently. I know that you tried a lot of different versions, but did you try to install PyScss==1.2.1?