Seahub fails to run initial start with ModuleNotFoundError - python

I'm currently trying to install seafile 7.1.4 on a Raspberry Pi 4 following the official guide (https://download.seafile.com/published/seafile-manual/deploy/using_mysql.md). The setup went smoothly, but when I try to start the seahub (./seahub start) for the first time I get the following error:
Traceback (most recent call last):
File "check_init_admin.py", line 351, in <module>
rpc = RPC()
File "check_init_admin.py", line 284, in __init__
import ccnet
ModuleNotFoundError: No module named 'ccnet'
I've been on google for the past two hours, but can't find a solution to this problem. What am I doing wrong?

I ran into the same issue. There's a bug in the 7.1.4 package. Seafile uses some local site packages. They (apparently) used to be under ${INSTALLPATH}/seafile/lib/python3.6/site-packages, now the are under ${INSTALLPATH}/seafile/lib/python3.7/site-packages
To fix:
open seahub.sh in the editor of your choice.
find the line that says:
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python3.6/site-packages:${INSTALLPATH}/seafile/lib64/python3.6/site-packages:${INSTALLPATH}/seahub:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH
change it to read:
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python3.7/site-packages:${INSTALLPATH}/seafile/lib64/python3.7/site-packages:${INSTALLPATH}/seahub:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH

Related

Error processing line 1 of distutils-precedence.pth (no module named '_distutils_hack')

I'm on Windows 10 and working in a git-bash terminal with anaconda environment. When I open a new terminal, I'm immediately presented with:
Error processing line 1 of C:\Users\e360769\AppData\Local\miniforge3\lib\site-packages\distutils-precedence.pth:
Traceback (most recent call last):
File "C:\Users\e360769\AppData\Local\miniforge3\lib\site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named '_distutils_hack'
Remainder of file ignored
This same error comes up any time I run "pip" or "python" on the command line. The command still executes correctly, but only after displaying that error. Note that this started after installing a collection of packages needed for a project I'm working with, and after investigating I found some people attributed this to the setuptools package (I have v41.2.0), but even when I uninstall it, the issue persists. Also note that this is the contents of my distutils-precedence.pth file:
import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get(var, 'local') == 'local'; enabled and __import__('_distutils_hack').add_shim();
I'm not sure this is actively (for now) causing any issues with executing my python scripts, etc., but I'd like to know what's going on and how to fix this. Would appreciate any help!

key error when running local app example with dev_appserver.py

I am trying to run the appengine-endpoints-helloendpoints-python app locally using the google cloud platform SDK (which has been added to my path) using the command dev_appserver.py from the command line. It used to run perfectly, but now when I try, I get an error:
Error processing line 2 of
/Users/hannah/anaconda3/envs/py27/lib/python2.7/site-packages/grpc_google_pubsub_v1-0.8.1-py2.7-nspkg.pth:
Traceback (most recent call last):
File "/Users/hannah/anaconda3/envs/py27/lib/python2.7/site.py", line 161, in addpackage
exec line
File "<string>", line 1, in <module>
KeyError: 'google'
Remainder of file ignored
It's in a anaconda python2.7 environment. I've tried looking in site.py but I can't follow it back to a clear missing link.
The appcfg.py command used to deploy from the command line doens't work at all anymore. The command is not found.
bash: appcfg.py: command not found
As I said, I reinstalled and authorised the google cloud SDK and it is added to my path and that hasn't solved anything.
Oh finally, the error comes up whenever I run the dev_appserver.py command, not just with the example code from google.
Any tips would be appreciated

Importing Rpy with python 2.6, R2.14 and Win 7x64 error

I am trying to import rpy into python. I keep getting this error.
Traceback (most recent call last):
File "<pyshell#0>", line 1, in module
import rpy
File "E:\Python26\lib\site-packages\rpy.py", line 58, in module
RVERSION = rpy_tools.get_R_VERSION(RHOME)
File "E:\Python26\lib\site-packages\rpy_tools.py", line 103, in get_R_VERSION
raise RuntimeError("Couldn't obtain version number from output\n"
RuntimeError: Couldn't obtain version number from output
of `R --version'.
I looked on the forums and found the following thread with the same issue. Followed what someone recommend there and I still get the same error. I have Rpy 1.0.3, Python 2.6, R2.14 and Windows 7 x64. I also have numpy 1.6.1 and pywin32 build 216 per recommended by the rpy site for windows installs.
Importing rpy module into python
R is in the path and the same error still occurs.
Added the path to the x64 R.exe. Also went in like the above post and added the extra +'s. Still runs in Command line but now getting a new error.
Traceback (most recent call last):
File "", line 1, in
import rpy
File "E:\Python26\Lib\site-packages\rpy.py", line 101, in
raise RuntimeError("Unable to locate R.dll within %s" % RHOME)
RuntimeError: Unable to locate R.dll within C:\Program Files\R\R-2.14.0
Going to search Stack for other errors witl the R.dll. Seems there are 2 R.dll's too. one in i386 and one in x64.
Found in rpy.py
if sys.platform=='win32':
import win32api
os.environ['PATH'] += ';' + os.path.join(RHOME,'bin')
So I added in after 'bin' a 'i386','x64','R.dll'. Still the same error even after I tell it where to look. Found some stuff on editing the "rinterface/init.py" but I can't find this file. Granted that was for rpy2 that seems to be running into the same problem.
Well not sure what I changed but now I am getting the following
Traceback (most recent call last):
File "", line 1, in
import rpy
File "E:\Python26\lib\site-packages\rpy.py", line 106, in
win32api.LoadLibrary( Rlib )
error: (126, 'LoadLibrary', 'The specified module could not be found.')
Tried it in x64 mode. Got an error that loadlibrary cant work in x64 as it is a win32 module. Went back to i386 and thus got an error saying rpy wont work with R2.14.0. Going to try a old version of R.
Upon further review I am an idiot. I downloaded rpy2 made the same following changes and it works like a charm.

RabbitVCS does not work because of python error

Hello
I cannot start running rabbitvcs on openSUSE 11.3 64bit.
I tried to run test.py file which is located in rabbitvcs folder.
It returns the following errors:
jenea#linux-nguv:/usr/lib/python2.6/site-packages/rabbitvcs> python test.py
Traceback (most recent call last):
File "test.py", line 26, in <module>
import lib.helper
File "/usr/lib/python2.6/site-packages/rabbitvcs/lib/__init__.py", line 23, in <module>
from rabbitvcs.lib.log import Log
ImportError: No module named lib.log
PS: I know that is not quite programming question but it seems to me that error occurs because of some paths or settings.
Unfortunately I've no idea where to dig.
Although stupid the answer is the following:
There were two folders where rabbitvcs was intalled. The first was in /usr/lib/rabbitvcs and the second was in /usr/lib64/rabbitvcs. I'm not sure why there was described issue but after I deleted rabbitvcs folder in /usr/lib64 it started to work normally.

SPSS Python Error

Getting the following error when trying to run SPSS from an external Python IDE.
import spss
yields the following error
Traceback (most recent call last):
File "C:\Documents and Settings\USER\workspace\SPSS\src\NE ASQ 2010.py", line 6, in <module>
import spss
File "C:\Python26\Lib\site-packages\spss180\spss\spss.py", line 16, in <module>
error = errCode()
File "C:\Python26\Lib\site-packages\spss180\spss\errMsg.py", line 24, in __init__
self.errMsg = errTable['okay'][str(0)]
KeyError: 'okay'
Ran the Python essentials plug-in with no errors. Funny thing is that I dont get an error when I run this in a syntax
BEGIN PROGRAM PYTHON.
import spss
num = spss.GetVariableCount()
print num
END PROGRAM.
Any help will be much appreciated.
Brock
I believe I figured out the issue. I needed to configure Eclipse to see the external python modules that are created when you install the SPSS/Python plugin. I had to set a reference to the modules when configuring the project.
Once I did that, it looks like I am up and running!

Categories