I am behind a corporate proxy. I am trying to download BERT's vocabulary.
_, vocab_bert = gluonnlp.model.bert_12_768_12(dataset_name='wiki_multilingual_uncased',
pretrained=False, root='./model')
HTTPSConnectionPool(host='apache-mxnet.s3-accelerate.dualstack.amazonaws.com',
port=443): Max retries exceeded with url:
/gluon/dataset/vocab/wiki_multilingual_uncased-2b2514cc.zip
(Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection
object at 0x7f43c2650b38>:
Failed to establish a new connection: [Errno -2] Name or service not known',))
How can provide my proxy data to gluonnlp in my Jupyter Notebook?
The solution I found was to set up the proxy in my Jupyter notebook:
import os
os.environ['http_proxy'] = "http://user:password01ge#proxy.com:8080/"
os.environ['https_proxy'] = "https://user:password01ge#proxy.com:8080/"
Related
I installed-
Rstudio
R 4.1.2
3)Anaconda
4)Python 3.9
The command I tried to execute-
install.packages("tensorflow")
install_tensorflow
The error I get after executing these-
Could not fetch URL https://pypi.org/simple/tensorflow/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/tensorflow/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement tensorflow==2.7.* (from versions: none)
ERROR: No matching distribution found for tensorflow==2.7.*
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Error: Error installing package(s): ""tensorflow==2.7.*""
I use RStudio from an AWS EC2 Windows. To get .pdf file from my rmarkdown I tried to install MiKTeX on my EC2 and faced some issue, so I decided to try the tinytex solution. I correctly installed the tinytex package but I had some trouble to install tinytex from it. For your info, following security reasons only selected websites are whitelisted. So to be able to install tinytex I asked for whitelisting:
yihui. org
miktex. org
ci.appveyor. com
www.ctan. org
but I still can't get tinytex installed on my EC2 Windows. I also downloaded separetely TinyTeX.zip to install it but tinytex:::install_windows_zip() is not available anymore.
When I try tinytex::install_tinytex() I got the following error:
trying URL 'https://yihui.org/tinytex/TinyTeX-1.zip'
trying URL 'https://yihui.org/tinytex/TinyTeX-1.zip'
trying URL 'https://yihui.org/tinytex/TinyTeX-1.zip'
Error in xfun::download_file(..., quiet = Sys.getenv("APPVEYOR") != "") :
No download method works (auto/wininet/wget/curl/lynx)
In addition: Warning messages:
1: In download.file(url, output, ..., method = method) :
InternetOpenUrl failed: 'A connection with the server could not be established'
2: In download.file(url, output, ..., method = method) :
URL 'https://appveyorcidatav2.blob.core.windows.net/yihui-27038/tinytex/1-0-1628/31j2ygh3xv2sk7xd/TinyTeX-1.zip?sv=2015-12-11&sr=c&sig=HJOnYMwO2zT2iFAlwT859FH53nzIHB0oV2RslIq990g%3D&st=2021-08-05T14%3A40%3A04Z&se=2021-08-05T14%3A46%3A04Z&sp=r': status was 'SSL connect error'
3: In download.file(url, output, ..., method = method) :
InternetOpenUrl failed: 'A connection with the server could not be established'
I am not sure to understand the error message, should I ask for whitelisting another websites?
Thanks in advance for any assistance on that.
Mhd
I have created a simple HTML page to control the movement of a simulated Gazebo Turtlebot using roslaunch rosbridge_server rosbridge_websocket.launch following this tutorial.
However, in the Web Console of the HTML page (F12) it shows the error "Firefox cant establish a connection to the server at ws://localhost:9090/." I am using the default rosbridge for the websocket(9090). In the Terminal I am also receiving the errors:
[-] failing WebSocket opening handshake ('WebSocket connection denied: origin 'null' not allowed')
[-] dropping connection to peer tcp4:127.0.0.1:41290 with abort=False: WebSocket connection denied: origin 'null' not allowed.
Does anyone have any suggestions on how I can fix this?
Given that you have followed the ROS tutorial and have created an HTML file as shown in Ros Bridge tutorial then you have to run:
runcore
rosrun rospy_tutorials add_two_ints_server
roslaunch rosbridge_server rosbridge_websocket.launch
Now that you have these up and running, you need to serve the html/javascript file (e.g. simple.html) and start the services etc. For example, you can serve the simple.html by using a SimpleHTTPServer, see below an example (e.g. simplehttpserver_test.py):
#!/usr/bin/env python
import SimpleHTTPServer
import SocketServer
class MyRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
if self.path == '/':
self.path = '/simple.html'
return SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
Handler = MyRequestHandler
server = SocketServer.TCPServer(('127.0.0.1', 9089), Handler)
server.serve_forever()
Once you run the simplehttpserver_test.py you can open the browser on 127.0.0.1:9089 and you should be able to have it working.
Note that SimpleHTTPServer serves files from the current directory and below, directly mapping the directory structure to HTTP requests, which means that the simple.html should be in the same (or below) directory as the simplehttpserver_test.py. Last, the port for the simplehttpserver_test.py should differ from the one used for the Rosbridge WebSocket server (e.g. default is 9090).
I´m newbie in this matter, and I don´t know why my application just work and runs in a open network, when is behind a proxy I have a return error.
I´m using a raspberry zero, with raspbian Stretch, using azure-iot-sdk-python and proxy squid
I already try this things:
The proxy allow HTTPS connection, and it has all PORT are available and without any restriction and the address *****. azure-devices.net is put inside a whitelist in
$ nano / etc / squid / whitelist
Beyond that I set the proxy in the operate system, raspbian Stretch, in the
$ nano / etc / environment
the follow configurations:
export http_proxy = "http://192.168.2.254:3128/"
export https_proxy = "https://192.168.2.254:3128/"
export no_proxy = "localhost, 127.0.0.1"
And also in
$ nano ~ / .bashrc
export http_proxy = http: //192.168.2.254:3128
export https_proxy = https: //192.168.2.254:3128
export no_proxy = localhost, 127.0.0.1
And,
$ nano /etc/apt/apt.conf.d/90proxy
Acquire :: http :: Proxy "http://192.168.2.254:3128/";
Acquire :: https :: Proxy "https://192.168.2.254:3128/";
from iothub_client import IoTHubClient, IoTHubTransportProvider, IoTHubMessage
import time
CONNECTION_STRING = "HostName=******.azure-devices.net;DeviceId=***;SharedAccessKey=*********"
PROTOCOL = IoTHubTransportProvider.MQTT
def send_confirmation_callback(message, result, user_context):
print("Confirmation received for message with result = %s" % (result))
if __name__ == '__main__':
client = IoTHubClient(CONNECTION_STRING, PROTOCOL)
message = IoTHubMessage("test message")
client.send_event_async(message, send_confirmation_callback, None)
print("Message transmitted to IoT Hub")
while True:
time.sleep(1)
Error: File: /usr/sdk/src/c/c-utility/adapters/socketio_berkeley.c Func: lookup_address_and_initiate_socket_connection Line: 282 Failure: getaddrinfo failure -3.
Error: File: /usr/sdk/src/c/c-utility/adapters/socketio_berkeley.c Func: socketio_open Line: 765 lookup_address_and_connect_socket failed
Error: File: /usr/sdk/src/c/c-utility/adapters/tlsio_openssl.c Func: on_underlying_io_open_complete Line: 760 Invalid tlsio_state. Expected state is TLSIO_STATE_OPENING_UNDERLYING_IO.
Error: File: /usr/sdk/src/c/c-utility/adapters/tlsio_openssl.c Func: tlsio_openssl_open Line: 1258 Failed opening the underlying I / O.
Error: File: /usr/sdk/src/c/umqtt/src/mqtt_client.c Func: mqtt_client_connect Line: 1000 Error: io_open failed
Error: File: /usr/sdk/src/c/iothub_client/src/iothubtransport_mqtt_common.c Func: SendMqttConnectMsg Line: 2122 failure connecting
You can not use a HTTP proxy with (native) MQTT, they are 2 totally separate protocols.
If you can use MQTT over WebSockets then you should be able to use a HTTP proxy as WebSockets are initially established by upgrading a HTTP connection.
If you have a SOCKS proxy available on your network, then you may be able to use that with native MQTT. The following question has hints on how to use a SOCKS proxy with Python. How can I use a SOCKS 4/5 proxy with urllib2?
I keep getting an error while updating conda:
CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://repo.anaconda.com/pkgs/r/noarch/repodata.json.bz2
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
ProxyError(MaxRetryError("HTTPSConnectionPool(host='repo.anaconda.com', port=443):
Max retries exceeded with url:
/pkgs/r/noarch/repodata.json.bz2 (
Caused by ProxyError(
'Cannot connect to proxy.',
OSError('Tunnel connection failed: 407 Proxy Authentication Required',)))",
),
)
A reportable application error has occurred. Conda has prepared the above report.
Upload did not complete.
I tried this in the .condarc file
proxy_servers:
http: http://proxy.corp.local:8080
https: https://proxy.corp.local:8080
and
proxy_servers:
http: http://user:pass#corp.com:8080
https: https://user:pass#corp.com:8080
ssl_verify: True
ssl_verify: False
Regards
Bjorn
I also got the same error message and it is solved after googling so much.
Steps for solving the problem is given below
Create a .condrac file using the conda config command in command prompt or use a text editor to create a text file. I used conda config for creating the .condrac file
You can add following line into the .condrac file located in your user home directory or home
directory
proxy_servers:
http: http://username:password#proxyIP/Proxy URL:port no
https: http://username:password#proxyIP/ProxyURL:port no
ssl_verify: True
Same file can be copied into your anaconda home directory.(C:\ProgramData\Anaconda3 in my case)
Then run > conda update conda command from your prompt
Then you will be getting the result like below. C:\Users\USER.DESKTOP-BQVL8L4>conda update conda
Solving environment: done
Rerun your installation command. This solution worked well for me. Please try and let me know.
Copy files libcrypto-1_1-x64.dll and libssl-1_1-x64.dll
from the directory ./Anaconda3/Library/bin/
to ./Anaconda3/DLLs.
This method solved the problem that I had