Move from Windows to Ubuntu (16.04) results in ImportError

#1

We are in process of moving our functioning Crossbar application to Ubuntu (16.04). After installation of crossbar and all of the other python libraries our app depends on, we now get ImportErrors for our application components. Does deployment on Ubuntu require changes to the config file? Seems like this would be a “pythonpath” issue, but we have not been able to resolve as yet…

“.crossbar” directory resides at same level as “dnf” application directory

“dnf” directory contains “dnf.py” which contains “AppSession” class

Beginning of config.json file where pythonpath specified:

{
“version”: 2,
“controller”: {},
“workers”: [
{
“type”: “router”,
“options”: {
“pythonpath”: [
“…”
]
},

Later in config file we define components:

        "components": [
            {
                "type": "class",
                "classname": "dnf.dnf.AppSession",
                "realm": "dnf",
                "role": "backend"
            },

Every time we start crossbar, we get exceptions.ImportError: No module named dnf.dnf

Again the identical configuration, source files, and directory structure works on Windows as is.

Help me convince my manager that Windows is not superior…

0 Likes

#2

Ok, your classname should be ., and .py should be present in whatever paths you include in “pythonpath” … AFAIK …

0 Likes

#3

Does your dnf directory contain a init.py file?

Where are you launching from?

I am using a config similar to yours and it works fine…

···

On Tuesday, 18 October 2016 19:17:58 UTC+2, Steve Ditlinger wrote:

We are in process of moving our functioning Crossbar application to Ubuntu (16.04). After installation of crossbar and all of the other python libraries our app depends on, we now get ImportErrors for our application components. Does deployment on Ubuntu require changes to the config file? Seems like this would be a “pythonpath” issue, but we have not been able to resolve as yet…

“.crossbar” directory resides at same level as “dnf” application directory

“dnf” directory contains “dnf.py” which contains “AppSession” class

Beginning of config.json file where pythonpath specified:

{
“version”: 2,
“controller”: {},
“workers”: [
{
“type”: “router”,
“options”: {
“pythonpath”: [
“…”
]
},

Later in config file we define components:

        "components": [
            {
                "type": "class",
                "classname": "dnf.dnf.AppSession",
                "realm": "dnf",
                "role": "backend"
            },

Every time we start crossbar, we get exceptions.ImportError: No module named dnf.dnf

Again the identical configuration, source files, and directory structure works on Windows as is.

Help me convince my manager that Windows is not superior…

0 Likes

#4

Yes, I was missing the init.py file…

That was the only problem…

Thank you!

···

On Tuesday, October 18, 2016 at 11:53:18 PM UTC-7, Adam Jorgensen wrote:

Does your dnf directory contain a init.py file?

Where are you launching from?

I am using a config similar to yours and it works fine…

On Tuesday, 18 October 2016 19:17:58 UTC+2, Steve Ditlinger wrote:

We are in process of moving our functioning Crossbar application to Ubuntu (16.04). After installation of crossbar and all of the other python libraries our app depends on, we now get ImportErrors for our application components. Does deployment on Ubuntu require changes to the config file? Seems like this would be a “pythonpath” issue, but we have not been able to resolve as yet…

“.crossbar” directory resides at same level as “dnf” application directory

“dnf” directory contains “dnf.py” which contains “AppSession” class

Beginning of config.json file where pythonpath specified:

{
“version”: 2,
“controller”: {},
“workers”: [
{
“type”: “router”,
“options”: {
“pythonpath”: [
“…”
]
},

Later in config file we define components:

        "components": [
            {
                "type": "class",
                "classname": "dnf.dnf.AppSession",
                "realm": "dnf",
                "role": "backend"
            },

Every time we start crossbar, we get exceptions.ImportError: No module named dnf.dnf

Again the identical configuration, source files, and directory structure works on Windows as is.

Help me convince my manager that Windows is not superior…

0 Likes

#5

It’s kinda shocking that it actually worked on windows, as it really shouldn’t have…

···

On Wednesday, 19 October 2016 14:09:25 UTC+2, Steve Ditlinger wrote:

Yes, I was missing the init.py file…

That was the only problem…

Thank you!

On Tuesday, October 18, 2016 at 11:53:18 PM UTC-7, Adam Jorgensen wrote:

Does your dnf directory contain a init.py file?

Where are you launching from?

I am using a config similar to yours and it works fine…

On Tuesday, 18 October 2016 19:17:58 UTC+2, Steve Ditlinger wrote:

We are in process of moving our functioning Crossbar application to Ubuntu (16.04). After installation of crossbar and all of the other python libraries our app depends on, we now get ImportErrors for our application components. Does deployment on Ubuntu require changes to the config file? Seems like this would be a “pythonpath” issue, but we have not been able to resolve as yet…

“.crossbar” directory resides at same level as “dnf” application directory

“dnf” directory contains “dnf.py” which contains “AppSession” class

Beginning of config.json file where pythonpath specified:

{
“version”: 2,
“controller”: {},
“workers”: [
{
“type”: “router”,
“options”: {
“pythonpath”: [
“…”
]
},

Later in config file we define components:

        "components": [
            {
                "type": "class",
                "classname": "dnf.dnf.AppSession",
                "realm": "dnf",
                "role": "backend"
            },

Every time we start crossbar, we get exceptions.ImportError: No module named dnf.dnf

Again the identical configuration, source files, and directory structure works on Windows as is.

Help me convince my manager that Windows is not superior…

0 Likes

closed #7
0 Likes