ho-fe3fdd00-12:~ Sam$ easy_install BeautifulSoup
Traceback (most recent call last):
File "/usr/bin/easy_install", line 8, in <module>
load_entry_point('setuptools==0.6c7', 'console_scripts', 'easy_install')()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/setuptools/command/easy_install.py", line 1670, in main
with_ei_usage(lambda:
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/setuptools/command/easy_install.py", line 1659, in with_ei_usage
return f()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/setuptools/command/easy_install.py", line 1674, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.py", line 125, in setup
dist.parse_config_files()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py", line 373, in parse_config_files
parser.read(filename)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ConfigParser.py", line 267, in read
self._read(fp, filename)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ConfigParser.py", line 462, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /Users/Sam/.pydistutils.cfg, line: 1
'install_lib = ~/Library/Python/$py_version_short/site-packages\n'
I am trying to install beautifulsoup.
The first two lines in ~/.pydistutils.cfg:
install_lib = ~/Library/Python/$py_version_short/site-packages
install_scripts = ~/bin
BeautifulSoup is a pure Python module which you can install by grabbing the BeautifulSoup.py file (eg. from inside the standard .tar.gz distribution) and putting it somewhere on your PythonPath - eg. inside /Users/Sam/Library/Python/2.5/site-packages, if the paths mentioned in the error message are accurate.
No need for fussy and error-prone installers which just overcomplicate the issue.
The configuration file .pydstutils.cfg has a syntax error.
Try to add the line at the top of ~/.pydistutils.cfg:
[easy_install]
Related
As you can see, I use the right command and it keeps telling me the usage instead of creating the right file for me.
enter image description here
(WebScraping) G:\>pipreqs G:\PY CODE\WebScraping
Usage:
pipreqs [options] [<path>]
And if I just randomly input the path file, it will tell me, file doesn`t exist.
(WebScraping) G:\>pipreqs s
Traceback (most recent call last):
File "D:\anaconda\envs\WebScraping\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\anaconda\envs\WebScraping\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "D:\anaconda\envs\WebScraping\Scripts\pipreqs.exe\__main__.py", line 7, in <module>
File "D:\anaconda\envs\WebScraping\lib\site-packages\pipreqs\pipreqs.py", line 488, in main
init(args)
File "D:\anaconda\envs\WebScraping\lib\site-packages\pipreqs\pipreqs.py", line 478, in init
generate_requirements_file(path, imports, symbol)
File "D:\anaconda\envs\WebScraping\lib\site-packages\pipreqs\pipreqs.py", line 157, in generate_requirements_file
with _open(path, "w") as out_file:
File "D:\anaconda\envs\WebScraping\lib\contextlib.py", line 135, in __enter__
return next(self.gen)
File "D:\anaconda\envs\WebScraping\lib\site-packages\pipreqs\pipreqs.py", line 81, in _open
file = open(filename, mode)
FileNotFoundError: [Errno 2] No such file or directory: 's\\requirements.txt'
I finally solve this issue when I cd my host path in cmd to the document path without giving arguments in pipreqs order like this:
(WebScraping) G:\PY CODE\WebScraping>pipreqs --encoding=utf8
INFO: Successfully saved requirements file in G:\PY CODE\WebScraping\requirements.txt
But how can I use the normal orders like eveyone else:
G:\PY CODE\WebScraping
This keeps bothering me
I wonder is there someth
Try adding quotes:
pipreqs "G:\PY CODE\WebScraping"
I was forced into some software updates on my laptop (ThinkPad) and after the update when I tried to open Spyder (via Anaconda) and it won't open. I don't have any experience in errors like this or fixing this stuff (and I am aware this may be something that is super simple). Please help. This is the application launch error I am getting:
Traceback (most recent call last):
File "C:\Users\cyrra\anaconda3\Scripts\spyder-script.py", line 10, in
sys.exit(main())
File "C:\Users\cyrra\anaconda3\lib\site-packages\spyder\app\start.py", line 205, in main
mainwindow.main()
File "C:\Users\cyrra\anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3651, in main
mainwindow = run_spyder(app, options, args)
File "C:\Users\cyrra\anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3526, in run_spyder
main.setup()
File "C:\Users\cyrra\anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 871, in setup
self.help = Help(self, css_path=css_path)
File "C:\Users\cyrra\anaconda3\lib\site-packages\spyder\plugins\help\plugin.py", line 68, in __init__
color_scheme = self.get_color_scheme()
File "C:\Users\cyrra\anaconda3\lib\site-packages\spyder\api\plugins.py", line 347, in get_color_scheme
return super(BasePluginWidget, self)._get_color_scheme()
File "C:\Users\cyrra\anaconda3\lib\site-packages\spyder\plugins\base.py", line 446, in _get_color_scheme
return get_color_scheme(CONF.get('appearance', 'selected'))
File "C:\Users\cyrra\anaconda3\lib\site-packages\spyder\config\gui.py", line 114, in get_color_scheme
color_scheme[key] = CONF.get("appearance", "%s/%s" % (name, key))
File "C:\Users\cyrra\anaconda3\lib\site-packages\spyder\config\manager.py", line 228, in get
return config.get(section=section, option=option, default=default)
File "C:\Users\cyrra\anaconda3\lib\site-packages\spyder\config\user.py", line 976, in get
return config.get(section=section, option=option, default=default)
File "C:\Users\cyrra\anaconda3\lib\site-packages\spyder\config\user.py", line 513, in get
raise cp.NoOptionError(option, section)
configparser.NoOptionError: No option 'custom-1/background' in section: 'appearance'
Thanks,
Rachel
Did you try to run spyder on the terminal?
It should be prebuild in Anaconda.
Your Spyder config file should contain but is missing 'custom-1/background' in section: 'appearance'. If you have no experience, the easiest thing for you to do is uninstall and install Spyder (via Anaconda). Your other option is to find the config file called in line 513 of C:\Users\cyrra\anaconda3\lib\site-packages\spyder\config\user.py". Then open the config file (if it exists) and correct it. If the file is not found, search for that config file and place it in the expected location.
I'm trying to run flake8 on a docker django built like described here (tutorial page)
when building the docker image I get an error from flake8 which is run in an docker-compose file with like so
$ flake8 --ignore=E501,F401 .
multiprocessing.pool.RemoteTraceback:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **
File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 48, in
return list(map(*
File "/usr/local/lib/python3.8/site-packages/flake8/checker.py", line 666, in
return checker.run_checks()
File "/usr/local/lib/python3.8/site-packages/flake8/checker.py", line 598, in run_checks
self.run_ast_checks()
File "/usr/local/lib/python3.8/site-packages/flake8/checker.py", line 495, in run_ast_checks
checker = self.run_check(plugin, tree=ast)
File "/usr/local/lib/python3.8/site-packages/flake8/checker.py", line 426, in run_check
self.processor.keyword_arguments_for( File "/usr/local/lib/python3.8/site-packages/flake8/processor.py", line 241, in keyword_arguments_for arguments[param] = getattr(self, param)
File "/usr/local/lib/python3.8/site-packages/flake8/processor.py", line 119, in file_tokens
self._file_tokens = list(
File "/usr/local/lib/python3.8/tokenize.py", line 525, in _tokenize
pseudomatch = _compile(PseudoToken).match(line, pos)
RuntimeError: internal error in regular expression engine
The above exception was the direct cause of the following exception: Traceback (most recent call last):
File "/usr/local/bin/flake8", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/flake8/main/cli.py", line 18, in main
app.run(argv)
File "/usr/local/lib/python3.8/site-packages/flake8/main/application.py", line 393, in run
self._run(argv)
File "/usr/local/lib/python3.8/site-packages/flake8/main/application.py", line 381, in _run
self.run_checks()
File "/usr/local/lib/python3.8/site-packages/flake8/main/application.py", line 300, in run_checks
self.file_checker_manager.run()
File "/usr/local/lib/python3.8/site-packages/flake8/checker.py", line 329, in run
self.run_parallel()
File "/usr/local/lib/python3.8/site-packages/flake8/checker.py", line 293, in run_parallel
for ret in pool_map:
File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 448, in <genexpr>
return (item for chunk in result for item in chunk)
File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 865, in next
raise value
RuntimeError: internal error in regular expression engine
When I run flake8 with the --verbose flag, I get an error like this:
Fatal Python error: deletion of interned string failed
Python runtime state: initialized
KeyError: 'FILENAME_RE'
from the tokenizer.py
Does anyone know how to solve this?
Additional Data:
running docker-compose v1.25.4 on an raspberry 3 with buster lite.
Installed and compiled Python 3.8.2 from source with the flag --enableloadable-sqlite
Thanks for helping!
If you don't care for flake8, then just delete that line. It will work. I had the same problem.
I know this isn't an answer. I would add a comment instead if I could.
I encountered a very similar error profile when I had refactored and left a lot of data which formerly had been in the top of the project down in what became the package folder. There were 33621 files including .venv, .nox, .pytest_cache, .coverage.
File "/usr/lib/python3.8/multiprocessing/pool.py", line 448, in <genexpr>
return (item for chunk in result for item in chunk)
File "/usr/lib/python3.8/multiprocessing/pool.py", line 868, in next
raise value
IndexError: string index out of range
If you see a similar signature (the parallel processing engine being overwhelmed in some way and throwing an exception), you may want to review your project directory structure and make sure that you did not put this kind of data in your sources directories.
I am using some legacy code from python2 that has to work with python3. So far so good, most of the things work as they should. However I get the most vage error from a library called lxml.
In my understanding this is a library that binds to a binary program written in c.
The problem comes from this piece of code:
with etree.xmlfile(self.temp_file, encoding='utf-8') as xf:
with xf.element('{http://www.opengis.net/citygml/2.0}CityModel', nsmap=nsmap):
with open(input_gml, mode='rb') as f:
context = etree.iterparse(f)
for action, elem in context:
if action == 'end' and elem.tag == '{http://www.opengis.net/citygml/2.0}cityObjectMember':
# Duplicate feature and subfeatures
self.duplicateFeature(xf, elem)
# Clean up the original element and the node of its previous sibling
# (https://www.ibm.com/developerworks/xml/library/x-hiperfparse/)
elem.clear()
while elem.getprevious() is not None:
del elem.getparent()[0]
del context
xf.flush()
It processes this xml file. And gets the following error:
Traceback (most recent call last):
File "/usr/local/bin/stetl", line 4, in <module>
__import__('pkg_resources').run_script('Stetl==2.0', 'stetl')
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1446, in run_script
exec(code, namespace, namespace)
File "/usr/local/lib/python3.6/site-packages/Stetl-2.0-py3.6.egg/EGG-INFO/scripts/stetl", line 43, in <module>
main()
File "/usr/local/lib/python3.6/site-packages/Stetl-2.0-py3.6.egg/EGG-INFO/scripts/stetl", line 36, in main
etl.run()
File "/usr/local/lib/python3.6/site-packages/Stetl-2.0-py3.6.egg/stetl/etl.py", line 157, in run
chain.run()
File "/usr/local/lib/python3.6/site-packages/Stetl-2.0-py3.6.egg/stetl/chain.py", line 172, in run
packet = self.first_comp.process(packet)
File "/usr/local/lib/python3.6/site-packages/Stetl-2.0-py3.6.egg/stetl/component.py", line 213, in process
packet = self.next.process(packet)
File "/usr/local/lib/python3.6/site-packages/Stetl-2.0-py3.6.egg/stetl/component.py", line 213, in process
packet = self.next.process(packet)
File "/usr/local/lib/python3.6/site-packages/Stetl-2.0-py3.6.egg/stetl/component.py", line 213, in process
packet = self.next.process(packet)
File "/usr/local/lib/python3.6/site-packages/Stetl-2.0-py3.6.egg/stetl/component.py", line 199, in process
packet = self.invoke(packet)
File "/app/bgt/etl/stetlbgt/subfeaturehandler.py", line 144, in invoke
del context
File "src/lxml/serializer.pxi", line 925, in lxml.etree.xmlfile.__exit__
File "src/lxml/serializer.pxi", line 1263, in lxml.etree._IncrementalFileWriter._close
File "src/lxml/serializer.pxi", line 1269, in lxml.etree._IncrementalFileWriter._handle_error
File "src/lxml/serializer.pxi", line 199, in lxml.etree._raiseSerialisationError
lxml.etree.SerialisationError: unknown error -2029930774
I'm not sure what's going wrong here. It seems that something is wrong with some weird encoded character.
How to debug this?
I'm using pyramid 1.5.1 and python 3.2, and I just added quite a bit of code and a couple libraries to my project.
On running development.ini, I'm getting the error below.
If I had to take a wild guess, I would say that this particular library (looks like Markupsafe?) isn't compatible with Python3...but the project page seems to indicate that it is. Problem is, I'm not calling this library directly, it's being used by another library that would be very difficult to replace.
I'm new to Python programming, and I was wondering what my options are here Or what the best way to debug is?
(finance-env)user1#finance1:/var/www/finance/corefinance/corefinance$ /var/www/finance/finance-env/bin/pserve /var/www/finance/corefinance/development.ini --reload
Starting subprocess with file monitor
Traceback (most recent call last):
File "/var/www/finance/finance-env/bin/pserve", line 9, in <module>
load_entry_point('pyramid==1.5.1', 'console_scripts', 'pserve')()
File "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/scripts/pserve.py", line 51, in main
return command.run()
File "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/scripts/pserve.py", line 316, in run
global_conf=vars)
File "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/scripts/pserve.py", line 340, in loadapp
return loadapp(app_spec, name=name, relative_to=relative_to, **kw)
File "/var/www/finance/finance-env/lib/python3.2/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/var/www/finance/finance-env/lib/python3.2/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/var/www/finance/finance-env/lib/python3.2/site-packages/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/var/www/finance/finance-env/lib/python3.2/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/var/www/finance/finance-env/lib/python3.2/site-packages/paste/deploy/util.py", line 55, in fix_call
val = callable(*args, **kw)
File "/var/www/finance/corefinance/corefinance/__init__.py", line 35, in main
session_factory=session_factory
File "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/config/__init__.py", line 301, in __init__
exceptionresponse_view=exceptionresponse_view,
File "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/config/__init__.py", line 412, in setup_registry
self.include(inc)
File "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/config/__init__.py", line 755, in include
c(configurator)
File "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid_debugtoolbar-2.1-py3.2.egg/pyramid_debugtoolbar/__init__.py", line 113, in includeme
config.include('pyramid_mako')
File "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/config/__init__.py", line 727, in include
c = self.maybe_dotted(callable)
File "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/config/__init__.py", line 825, in maybe_dotted
return self.name_resolver.maybe_resolve(dotted)
File "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/path.py", line 320, in maybe_resolve
return self._resolve(dotted, package)
File "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/path.py", line 327, in _resolve
return self._zope_dottedname_style(dotted, package)
File "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid/path.py", line 370, in _zope_dottedname_style
found = __import__(used)
File "/var/www/finance/finance-env/lib/python3.2/site-packages/pyramid_mako-1.0.2-py3.2.egg/pyramid_mako/__init__.py", line 18, in <module>
from mako.lookup import TemplateLookup
File "/var/www/finance/finance-env/lib/python3.2/site-packages/Mako-1.0.0-py3.2.egg/mako/lookup.py", line 9, in <module>
from mako.template import Template
File "/var/www/finance/finance-env/lib/python3.2/site-packages/Mako-1.0.0-py3.2.egg/mako/template.py", line 10, in <module>
from mako.lexer import Lexer
File "/var/www/finance/finance-env/lib/python3.2/site-packages/Mako-1.0.0-py3.2.egg/mako/lexer.py", line 11, in <module>
from mako import parsetree, exceptions, compat
File "/var/www/finance/finance-env/lib/python3.2/site-packages/Mako-1.0.0-py3.2.egg/mako/parsetree.py", line 9, in <module>
from mako import exceptions, ast, util, filters, compat
File "/var/www/finance/finance-env/lib/python3.2/site-packages/Mako-1.0.0-py3.2.egg/mako/filters.py", line 38, in <module>
import markupsafe
File "/var/www/finance/finance-env/lib/python3.2/site-packages/MarkupSafe-0.23-py3.2-linux-x86_64.egg/markupsafe/__init__.py", line 70
def __new__(cls, base=u'', encoding=None, errors='strict'):
^
SyntaxError: invalid syntax
The MarkupSafe package uses syntax only supported by Python 3.3 and up. Python 3.2 is not supported anymore as of version 0.16.
The u'unicode' literal syntax was introduced in PEP 414 to make it easier to create library code that can support both Python 2 and 3.
Either upgrade to Python 3.3 (or 3.4 even), or downgrade MarkupSafe to 0.15, the last version to support Python 3.2.
I do see that Mako removes the MarkupSafe dependency when you are using Python 3.2; if nothing else depends on it is perhaps safe to remove the package altogether. The mako.filter source code certainly will fall back to a local implementation if the package is not installed.