You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/02/20 07:33:43 UTC
[GitHub] [pulsar] karthikVaragini opened a new issue #14386: ImportError: No module named _pulsar
karthikVaragini opened a new issue #14386:
URL: https://github.com/apache/pulsar/issues/14386
#### Expected behavior
I'm just trying to execute the format-phone-number example in local
I'm using the Python3
I have installed the
pulsar 2.0.2
pulsar-client 2.9.1
I'm using bin/pulsar standalone (2.6.0)
I tried to localrun the pulsar function using the below command
bin/pulsar-admin functions localrun \
--broker-service-url pulsar://localhost:6650 \
--tenant public \
--namespace default \
--py /tmp/format-phone-number.zip \
--classname phoneValidation.TestEtl \
--inputs persistent://public/default/in \
--output persistent://public/default/out \
--log-topic persistent://public/default/log \
--state-storage-service-url bk://127.0.0.1:4181
after running the above command I got the following error
**File "/home/karthik/apache-pulsar-2.6.0/instances/python-instance/python_instance_main.py", line 36, in <module>
import pulsar
File "/home/karthik/apache-pulsar-2.6.0/instances/python-instance/pulsar/__init__.py", line 102, in <module>
import _pulsar
ImportError: No module named _pulsar**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] daiwei233 edited a comment on issue #14386: ImportError: No module named _pulsar
Posted by GitBox <gi...@apache.org>.
daiwei233 edited a comment on issue #14386:
URL: https://github.com/apache/pulsar/issues/14386#issuecomment-1047445999
I have the same promblem. I run `function worker` with broker, and I have installed `python3.6` and `pulsar-client==2.9.1` with my broker.
**pulsar version:** 2.9.1
**create command:** `pulsar-admin functions create --py myfunc.py --classname myfunc.WordCountFunction --inputs persistent://public/default/in --output persistent://public/default/out`
**myfunc.py:**
```python
class WordCountFunction(Function):
def __init__(self):
pass
def process(self, input, context):
words = input.split()
for word in words:
context.incr_counter(word, 1)
context.get_logger().info("The value is " + str(context.get_counter(word)))
return input + "!"
```
**broker log:**
```
Traceback (most recent call last):
File "/opt/work/apache-pulsar-2.9.1/instances/python-instance/python_instance_main.py", line 36, in <module>
import pulsar
File "/opt/work/apache-pulsar-2.9.1/instances/python-instance/pulsar/__init__.py", line 103, in <module>
import _pulsar
ImportError: No module named _pulsar
```
**function status:**
```
pulsar-admin functions status --name WordCountFunction
{
"numInstances" : 1,
"numRunning" : 0,
"instances" : [ {
"instanceId" : 0,
"status" : {
"running" : false,
"error" : "UNAVAILABLE: io exception",
"numRestarts" : 0,
"numReceived" : 0,
"numSuccessfullyProcessed" : 0,
"numUserExceptions" : 0,
"latestUserExceptions" : [ ],
"numSystemExceptions" : 0,
"latestSystemExceptions" : [ ],
"averageLatency" : 0.0,
"lastInvocationTime" : 0,
"workerId" : "work1-8080"
}
} ]
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] daiwei233 commented on issue #14386: ImportError: No module named _pulsar
Posted by GitBox <gi...@apache.org>.
daiwei233 commented on issue #14386:
URL: https://github.com/apache/pulsar/issues/14386#issuecomment-1047445999
I have the same promblem. I run `function worker` with broker, and I have installed `python3.6` and `pulsar-client==2.9.1` with my broker.
**pulsar version:** 2.9.1
**create command:** `pulsar-admin functions create --py myfunc.py --classname myfunc.WordCountFunction --inputs persistent://public/default/in --output persistent://public/default/out`=
**myfunc.py:**
```python
class WordCountFunction(Function):
def __init__(self):
pass
def process(self, input, context):
words = input.split()
for word in words:
context.incr_counter(word, 1)
context.get_logger().info("The value is " + str(context.get_counter(word)))
return input + "!"
```
**broker log:**
```
Traceback (most recent call last):
File "/opt/work/apache-pulsar-2.9.1/instances/python-instance/python_instance_main.py", line 36, in <module>
import pulsar
File "/opt/work/apache-pulsar-2.9.1/instances/python-instance/pulsar/__init__.py", line 103, in <module>
import _pulsar
ImportError: No module named _pulsar
```
**function status:**
```
pulsar-admin functions status --name WordCountFunction
{
"numInstances" : 1,
"numRunning" : 0,
"instances" : [ {
"instanceId" : 0,
"status" : {
"running" : false,
"error" : "UNAVAILABLE: io exception",
"numRestarts" : 0,
"numReceived" : 0,
"numSuccessfullyProcessed" : 0,
"numUserExceptions" : 0,
"latestUserExceptions" : [ ],
"numSystemExceptions" : 0,
"latestSystemExceptions" : [ ],
"averageLatency" : 0.0,
"lastInvocationTime" : 0,
"workerId" : "work1-8080"
}
} ]
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org