Can not start Spark-shell - apache-spark

Hello I've unzip and exported spark path. Whne I lunch it I got this error.
export PATH=$PATH:/usr/local/spark/spark24/bin
$ spark-shell
ERROR
Traceback (most recent call last):
File "/usr/local/bin/find_spark_home.py", line 74, in <module>
print(_find_spark_home())
File "/usr/local/bin/find_spark_home.py", line 56, in _find_spark_home
module_home = os.path.dirname(find_spec("pyspark").origin)
AttributeError: 'NoneType' object has no attribute 'origin'
/usr/local/bin/spark-shell: line 57: /bin/spark-submit: No such file or directory
What's my problem.

Did you set SPARK_HOME?
export SPARK_HOME=/usr/local/spark/spark24

Related

Autocomplete-Python not working, ATOM, Error from jed, grammer 3.9.txt not found

I upgraded my python version from 3.8 to 3.9. I was using autocomplete-Pythonn extension. And an error came in my atom editor. That grammer3.9.txt not found.
Looks like this error originated from Jedi. Please do not report such issues in autocomplete-python issue tracker. Report them directly to Jedi. Turn off outputProviderErrors setting to hide such errors in future. Traceback output:
*Traceback (most recent call last):
File "C:\Users\hp.atom\packages\autocomplete-python\lib\jedi\parser_init_.py", line 56, in load_grammar
return _loaded_grammars[path]
KeyError: 'C:\Users\hp\.atom\packages\autocomplete-python\lib\jedi\parser\grammar3.9.txt'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\hp.atom\packages\autocomplete-python\lib\completion.py", line 376, in watch
self._process_request(request)
File "C:\Users\hp.atom\packages\autocomplete-python\lib\completion.py", line 338, in process_request
script = jedi.api.Script(
File "C:\Users\hp.atom\packages\autocomplete-python\lib\jedi\api_init.py", line 126, in init
self.grammar = load_grammar(version='%s.%s' % sys.version_info[:2])
File "C:\Users\hp.atom\packages\autocomplete-python\lib\jedi\parser_init.py", line 58, in load_grammar
return _loaded_grammars.setdefault(path, generate_grammar(path))
File "C:\Users\hp.atom\packages\autocomplete-python\lib\jedi\parser\pgen2\pgen.py", line 393, in generate_grammar
p = ParserGenerator(filename)
File "C:\Users\hp.atom\packages\autocomplete-python\lib\jedi\parser\pgen2\pgen.py", line 18, in init
stream = open(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\hp\.atom\packages\autocomplete-python\lib\jedi\parser\grammar3.9.txt'
I came up with this error last time. But then I Just renamed the file grammer3.7 to grammer3.8. But I do not think this is the right way to do so.

Vypython: AttributeError: 'box' object has no attribute 'idx'

I am new to vpython and trying to learn. However, right after installing the module with "pip install vpython" and making a python file that contains this :
from vpython import *
box()
I am greeted with an error:
Traceback (most recent call last):
File "C:/Users/remis/Downloads/Test Vpython.py", line 2, in <module>
box()
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 1099, in __init__
super(box, self).setup(args)
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 579, in setup
super(standardAttributes, self).__init__()
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 236, in __init__
from .no_notebook import _
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\no_notebook.py", line 271, in <module>
__w = threading.Thread(target=__server.serve_forever)
NameError: name '__server' is not defined
Exception ignored in: <function standardAttributes.__del__ at 0x00000182B9D4EAF0>
Traceback (most recent call last):
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 1092, in __del__
super(standardAttributes, self).__del__()
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 317, in __del__
cmd = {"cmd": "delete", "idx": self.idx}
AttributeError: 'box' object has no attribute 'idx'
I don't see any help online, can I get some please?

python3 File "<frozen importlib._bootstrap>", line 2218, in _find_and_load_unlocked AttributeError: 'module' object has no attribute '__path__'

My code is runnning in respberry pi 3 and I have error messages while trying to open it in terminal. What's wrong with my code, or where I made mistakes?
And I tried to rename it , but it does not work
import work.py
Traceback (most recent call last):
File "", line 2218, in
_find_and_load_unlocked
AttributeError: 'module' object has no attribute 'path'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "< stdin>", line 1, in < module>
ImportError: No module named 'work.py'; 'work' is not a package

AttributeError: 'module' object has no attribute 'packages'

when running test i'm getting this error.
earlier i'm using python-requests v2.2.1.so,
i have upgraded python-requests to v2.14.2 but still i'm facing the same issue.
HeaderDict(requests.packages.urllib3._collections.HTTPHeaderDict):
AttributeError: 'module' object has no attribute 'packages'check the below result:
======================================================================
ERROR: rest_blog.tests.test_views (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/unittest/case.py", line 58, in testPartExecutor
yield
File "/usr/lib/python3.4/unittest/case.py", line 577, in run
testMethod()
File "/usr/lib/python3.4/unittest/loader.py", line 32, in testFailure
raise exception
ImportError: Failed to import test module: rest_blog.tests.test_views
Traceback (most recent call last):
File "/usr/lib/python3.4/unittest/loader.py", line 312, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python3.4/unittest/loader.py", line 290, in _get_module_from_name
__import__(name)
File "/home/vamsi/PycharmProjects/ReminderToDo/rest_blog/tests/test_views.py", line 6, in <module>
from rest_framework.test import force_authenticate
File "/usr/local/lib/python3.4/dist-packages/rest_framework/test.py", line 30, in <module>
class HeaderDict(requests.packages.urllib3._collections.HTTPHeaderDict):
AttributeError: 'module' object has no attribute 'packages'
----------------------------------------------------------------------
Just reinstalling requests or upgrading requests should solve the problem.
pip install --upgrade requests

flask-sqlacodegen suports python 3.4?

I am trying to generate a flask-sqlalchemy for an existing mysql db.
I used the following command
flask-sqlacodegen --outfile rcdb.py mysql://username:password#hostname/tablename
The project uses python 3.4. Any clues?
```Traceback (most recent call last):
File "/var/www/devaccess/py_api/ds/venv/bin/flask-sqlacodegen", line 11, in
sys.exit(main())
File "/var/www/devaccess/py_api/ds/venv/lib/python3.4/site-packages/sqlacodegen/main.py", line 59, in main
Traceback (most recent call last):
File "/var/www/devaccess/py_api/ds/venv/bin/flask-sqlacodegen", line 11, in
sys.exit(main())
File "/var/www/devaccess/py_api/ds/venv/lib/python3.4/site-packages/sqlacodegen/main.py", line 59, in main
args.flask, ignore_cols, args.noclasses)
File "/var/www/devaccess/py_api/ds/venv/lib/python3.4/site-packages/sqlacodegen/codegen.py", line 606, in init
model = ModelClass(table, links[table.name], inflect_engine, not nojoined)
File "/var/www/devaccess/py_api/ds/venv/lib/python3.4/site-packages/sqlacodegen/codegen.py", line 335, in init
relationship_ = ManyToManyRelationship(self.name, target_cls, association_table, inflect_engine)
File "/var/www/devaccess/py_api/ds/venv/lib/python3.4/site-packages/sqlacodegen/codegen.py", line 501, in init
self.kwargs['secondary'] = repr(assocation_table.schema + '.' + assocation_table.name)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
```
try specifying your database schema with option --schema

Resources