xybu / onedrived-dev

A Microsoft OneDrive client for Linux, written in Python3.
https://github.com/xybu/onedrived-dev
MIT License
706 stars 78 forks source link

Cannot install. I get error: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) #75

Closed Skirtum closed 6 years ago

Skirtum commented 6 years ago

I've been trying to install onedrived-dev, but I get this error as soon as I'll try to run onedrived-pref --help after successfull installation of the program:

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Can you please help me to understand what's wrong and help me to fix it somehow?

derrix060 commented 6 years ago

Hello, can send the entire error stack?

Skirtum commented 6 years ago

Here it is:

~ $ onedrived-pref --help Traceback (most recent call last): File "/home/skirtum/.local/bin/onedrived-pref", line 11, in load_entry_point('onedrived==2.0.0', 'console_scripts', 'onedrived-pref')() File "/usr/local/lib/python3.6/site-packages/pkg_resources/init.py", line 572, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/local/lib/python3.6/site-packages/pkg_resources/init.py", line 2769, in load_entry_point return ep.load() File "/usr/local/lib/python3.6/site-packages/pkg_resources/init.py", line 2422, in load return self.resolve() File "/usr/local/lib/python3.6/site-packages/pkg_resources/init.py", line 2428, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/usr/local/lib/python3.6/site-packages/onedrived/od_pref.py", line 20, in context = load_context() File "/usr/local/lib/python3.6/site-packages/onedrived/od_context.py", line 30, in load_context ctx.load_config(ctx.DEFAULT_CONFIG_FILENAME) File "/usr/local/lib/python3.6/site-packages/onedrived/od_context.py", line 178, in load_config config = json.load(f) File "/usr/local/lib/python3.6/json/init.py", line 299, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/usr/local/lib/python3.6/json/init.py", line 354, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Skirtum commented 6 years ago

It could be, that something's wrong with onedrived_config_v2.json, but I'm not sure what and how to solve it :/

Skirtum commented 6 years ago

Here some more debug info:

~/onedrived-dev $ sudo python3 ./setup.py test running test Searching for requests-mock Reading https://pypi.python.org/simple/requests-mock/ Downloading https://pypi.python.org/packages/8d/cb/1267d7294d97e9a3ef24bf1370791da4d2dc6abc0f67626f38f4bf25dfa3/requests-mock-1.3.0.tar.gz#md5=d2efbaf16d19153b7d271628071b4d4b Best match: requests-mock 1.3.0 Processing requests-mock-1.3.0.tar.gz Writing /tmp/easy_install-kk8dgjxo/requests-mock-1.3.0/setup.cfg Running requests-mock-1.3.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-kk8dgjxo/requests-mock-1.3.0/egg-dist-tmp-c2tslywj

Installed /tmp/easy_install-kk8dgjxo/requests-mock-1.3.0/.eggs/pbr-3.1.1-py3.6.egg creating /home/skirtum/onedrived-dev/.eggs/requests_mock-1.3.0-py3.6.egg Extracting requests_mock-1.3.0-py3.6.egg to /home/skirtum/onedrived-dev/.eggs

Installed /home/skirtum/onedrived-dev/.eggs/requests_mock-1.3.0-py3.6.egg running egg_info creating onedrived.egg-info writing onedrived.egg-info/PKG-INFO writing dependency_links to onedrived.egg-info/dependency_links.txt writing entry points to onedrived.egg-info/entry_points.txt writing requirements to onedrived.egg-info/requires.txt writing top-level names to onedrived.egg-info/top_level.txt writing manifest file 'onedrived.egg-info/SOURCES.txt' reading manifest file 'onedrived.egg-info/SOURCES.txt' writing manifest file 'onedrived.egg-info/SOURCES.txt' running build_ext Traceback (most recent call last): File "./setup.py", line 63, in zip_safe=False File "/usr/local/lib/python3.6/site-packages/setuptools/init.py", line 129, in setup return distutils.core.setup(attrs) File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/usr/local/lib/python3.6/site-packages/setuptools/command/test.py", line 226, in run self.run_tests() File "/usr/local/lib/python3.6/site-packages/setuptools/command/test.py", line 249, in run_tests exit_kwarg File "/usr/local/lib/python3.6/unittest/main.py", line 93, in init self.parseArgs(argv) File "/usr/local/lib/python3.6/unittest/main.py", line 140, in parseArgs self.createTests() File "/usr/local/lib/python3.6/unittest/main.py", line 147, in createTests self.module) File "/usr/local/lib/python3.6/unittest/loader.py", line 219, in loadTestsFromNames suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/local/lib/python3.6/unittest/loader.py", line 219, in suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/local/lib/python3.6/unittest/loader.py", line 190, in loadTestsFromName return self.loadTestsFromModule(obj) File "/usr/local/lib/python3.6/site-packages/setuptools/command/test.py", line 52, in loadTestsFromModule tests.append(self.loadTestsFromName(submodule)) File "/usr/local/lib/python3.6/unittest/loader.py", line 153, in loadTestsFromName module = import(module_name) File "/home/skirtum/onedrived-dev/tests/test_pref_cli.py", line 10, in from onedrived import get_resource, od_pref File "/home/skirtum/onedrived-dev/onedrived/od_pref.py", line 20, in context = load_context() File "/home/skirtum/onedrived-dev/onedrived/od_context.py", line 30, in load_context ctx.load_config(ctx.DEFAULT_CONFIG_FILENAME) File "/home/skirtum/onedrived-dev/onedrived/od_context.py", line 178, in load_config config = json.load(f) File "/usr/local/lib/python3.6/json/init.py", line 299, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/usr/local/lib/python3.6/json/init.py", line 354, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

derrix060 commented 6 years ago

Thank you. Can you also put your onedrived_config_v2.json?

Skirtum commented 6 years ago

It's just empty (0 bytes). under /home/skirtum/.config/onedrived: https://flic.kr/p/21DWdwF

derrix060 commented 6 years ago

that is the problem. have you installed the projectnfrom scratch??

Skirtum commented 6 years ago

I think I did followed all instructions from start to end. I'll try to uninstall onedrived and try to delete this file and then - reinstall

Skirtum commented 6 years ago

It looks like it did helped! Thanks! I guess someone could include deletion of the "onedrived" directory from the .config folder into "uninstall" proceduress

Skirtum commented 6 years ago

But now I get this error:

$ onedrived-pref --help WARNING:root:Failed to load config file: [Errno 2] No such file or directory: '/home/skirtum/.config/onedrived/onedrived_config_v2.json'. Use default.

I guess this file should be created. But installation didn't do that. I've used PIP installation. Maybe I should do the manuall one...

Skirtum commented 6 years ago

I did the manuall installation but result is the same. No "onedrived_config_v2.json" file was created under /home/skirtum/.config/onedrived

Maybe I can create it manually? :)

Skirtum commented 6 years ago

I've tried to add account, but I got this error:

Successfully authorized onedrived. Failed to save account: No recommended backend was available. Install the keyrings.alt package if you want to use the non-recommended backends. See README.rst for details..

Skirtum commented 6 years ago

https://github.com/xybu/onedrived-dev/issues/72 :) found it. Solved it.

Skirtum commented 6 years ago

Thank you @derrix060 !!!